home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 6 / develop 6 < prev   
MacBinary  |  1994-07-24  |  2.8 MB  |  [ONLN/HLX2]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Wed Oct 13 13:25:09 1993, modified Sun Jul 24 14:36:21 1994, creator 'HLX2', type 'ONLN', 2932882 bytes "develop 6" , at 0x2cc112 32970 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[ONLN]
macFileCreator[HLX2]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 64 65 76 65 6c 6f | 70 20 36 00 00 00 00 00 |..develo|p 6.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 2c c0 92 00 | 00 80 ca a8 e1 ea 75 aa |....,...|......u.|
|00000060| 58 65 25 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |Xe%.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ba 64 00 00 |........|.....d..|
|00000080| 64 65 76 65 6c 6f 70 0d | 54 68 65 20 41 70 70 6c |develop.|The Appl|
|00000090| 65 20 54 65 63 68 6e 69 | 63 61 6c 20 4a 6f 75 72 |e Techni|cal Jour|
|000000a0| 6e 61 6c 0d 09 54 48 52 | 45 41 44 53 20 4f 4e 20 |nal..THR|EADS ON |
|000000b0| 54 48 45 20 4d 41 43 49 | 4e 54 4f 53 48 0d 51 55 |THE MACI|NTOSH.QU|
|000000c0| 49 43 4b 44 52 41 57 27 | 53 0d 43 4f 50 59 42 49 |ICKDRAW'|S.COPYBI|
|000000d0| 54 53 0d 50 52 4f 43 45 | 44 55 52 45 3a 0d 42 45 |TS.PROCE|DURE:.BE|
|000000e0| 54 54 45 52 20 54 48 41 | 4e 20 45 56 45 52 0d 49 |TTER THA|N EVER.I|
|000000f0| 4e 20 53 59 53 54 45 4d | 20 37 2e 30 0d 4d 41 43 |N SYSTEM| 7.0.MAC|
|00000100| 54 43 50 20 43 4f 4f 4b | 42 4f 4f 4b 3a 0d 43 4f |TCP COOK|BOOK:.CO|
|00000110| 4e 53 54 52 55 43 54 49 | 4e 47 0d 4e 45 54 57 4f |NSTRUCTI|NG.NETWO|
|00000120| 52 4b 2d 41 57 41 52 45 | 0d 41 50 50 4c 49 43 41 |RK-AWARE|.APPLICA|
|00000130| 54 49 4f 4e 53 0d 41 20 | 46 41 4d 49 4c 49 41 52 |TIONS.A |FAMILIAR|
|00000140| 0d 28 49 4e 54 45 52 29 | 46 41 43 45 0d 43 4f 4c |.(INTER)|FACE.COL|
|00000150| 4f 52 20 50 52 49 4e 54 | 49 4e 47 0d 57 49 54 48 |OR PRINT|ING.WITH|
|00000160| 20 4c 41 53 45 52 57 52 | 49 54 45 52 0d 36 2e 30 | LASERWR|ITER.6.0|
|00000170| 20 52 45 56 49 53 49 54 | 45 44 0d 4d 41 43 49 4e | REVISIT|ED.MACIN|
|00000180| 54 4f 53 48 20 51 20 26 | 20 41 0d 41 50 50 4c 45 |TOSH Q &| A.APPLE|
|00000190| 20 49 49 20 51 20 26 20 | 41 0d 59 4f 55 52 20 44 | II Q & |A.YOUR D|
|000001a0| 45 56 45 4c 4f 50 45 52 | 0d 45 53 53 45 4e 54 49 |EVELOPER|.ESSENTI|
|000001b0| 41 4c 53 20 44 49 53 43 | 0d 28 4e 4f 57 20 57 49 |ALS DISC|.(NOW WI|
|000001c0| 54 48 20 43 4f 44 45 0d | 53 4e 49 50 50 45 54 53 |TH CODE.|SNIPPETS|
|000001d0| 29 0d f0 0d 49 73 73 75 | 65 20 36 20 20 20 53 70 |)...Issu|e 6 Sp|
|000001e0| 72 69 6e 67 20 31 39 39 | 31 0d 41 70 70 6c 65 20 |ring 199|1.Apple |
|000001f0| 43 6f 6d 70 75 74 65 72 | 2c 20 49 6e 63 2e 09 0d |Computer|, Inc...|
|00000200| 0d 45 20 44 20 49 20 54 | 20 4f 20 52 20 49 20 41 |.E D I T| O R I A|
|00000210| 20 4c 0d 45 64 69 74 6f | 72 2d 69 6e 2d 43 68 65 | L.Edito|r-in-Che|
|00000220| 65 6b 20 20 43 61 72 6f | 6c 69 6e 65 20 52 6f 73 |ek Caro|line Ros|
|00000230| 65 0d 53 70 69 72 69 74 | 65 64 20 47 75 69 64 65 |e.Spirit|ed Guide|
|00000240| 20 20 4c 6f 75 65 6c 6c | 61 20 50 69 7a 7a 75 74 | Louell|a Pizzut|
|00000250| 69 0d 54 65 63 68 6e 69 | 63 61 6c 20 42 75 63 6b |i.Techni|cal Buck|
|00000260| 73 74 6f 70 70 65 72 20 | 20 44 61 76 65 20 4a 6f |stopper | Dave Jo|
|00000270| 68 6e 73 6f 6e 0d 4d 61 | 6e 61 67 69 6e 67 20 45 |hnson.Ma|naging E|
|00000280| 64 69 74 6f 72 20 20 4d | 6f 6e 69 63 61 20 4d 65 |ditor M|onica Me|
|00000290| 66 66 65 72 74 0d 43 6f | 6e 74 72 69 62 75 74 69 |ffert.Co|ntributi|
|000002a0| 6e 67 20 45 64 69 74 6f | 72 73 20 20 4c 6f 72 72 |ng Edito|rs Lorr|
|000002b0| 61 69 6e 65 20 41 6e 64 | 65 72 73 6f 6e 2c 0d 09 |aine And|erson,..|
|000002c0| 47 65 74 61 20 43 61 72 | 6c 73 6f 6e 2c 20 54 6f |Geta Car|lson, To|
|000002d0| 6e 69 20 48 61 73 6b 65 | 6c 6c 2c 20 4a 75 64 79 |ni Haske|ll, Judy|
|000002e0| 20 48 65 6c 66 61 6e 64 | 2c 20 09 61 6e 64 20 52 | Helfand|, .and R|
|000002f0| 69 6c 6c 61 20 52 65 79 | 6e 6f 6c 64 73 0d 45 64 |illa Rey|nolds.Ed|
|00000300| 69 74 6f 72 69 61 6c 20 | 41 73 73 69 73 74 61 6e |itorial |Assistan|
|00000310| 74 20 20 48 65 6c 65 6e | 20 53 74 65 61 0d 49 6e |t Helen| Stea.In|
|00000320| 64 65 78 65 72 20 20 49 | 72 61 20 4b 6c 65 69 6e |dexer I|ra Klein|
|00000330| 62 65 72 67 0d 4d 61 6e | 61 67 65 72 2c 20 44 65 |berg.Man|ager, De|
|00000340| 76 65 6c 6f 70 65 72 20 | 54 65 63 68 6e 69 63 61 |veloper |Technica|
|00000350| 6c 20 43 6f 6d 6d 75 6e | 69 63 61 74 69 6f 6e 73 |l Commun|ications|
|00000360| 0d 09 44 61 76 69 64 20 | 4b 72 61 74 68 77 6f 68 |..David |Krathwoh|
|00000370| 6c 0d 41 20 52 20 54 20 | 20 26 20 20 50 20 52 20 |l.A R T | & P R |
|00000380| 4f 20 44 20 55 20 43 20 | 54 20 49 20 4f 20 4e 0d |O D U C |T I O N.|
|00000390| 50 72 6f 64 75 63 74 69 | 6f 6e 20 4d 61 6e 61 67 |Producti|on Manag|
|000003a0| 65 72 20 20 48 61 72 74 | 6c 65 79 20 4c 65 73 73 |er Hart|ley Less|
|000003b0| 65 72 0d 41 72 74 20 44 | 69 72 65 63 74 6f 72 20 |er.Art D|irector |
|000003c0| 20 44 69 61 6e 65 20 57 | 69 6c 63 6f 78 0d 44 65 | Diane W|ilcox.De|
|000003d0| 73 69 67 6e 20 20 4a 6f | 73 73 20 50 61 72 73 65 |sign Jo|ss Parse|
|000003e0| 79 0d 54 65 63 68 6e 69 | 63 61 6c 20 49 6c 6c 75 |y.Techni|cal Illu|
|000003f0| 73 74 72 61 74 69 6f 6e | 20 20 44 6f 6e 20 44 6f |stration| Don Do|
|00000400| 6e 6f 75 67 68 65 20 61 | 6e 64 0d 09 44 69 61 6e |noughe a|nd..Dian|
|00000410| 65 20 57 69 6c 63 6f 78 | 0d 46 6f 72 6d 61 74 74 |e Wilcox|.Formatt|
|00000420| 69 6e 67 20 20 41 75 74 | 6f 6d 61 74 72 69 78 0d |ing Aut|omatrix.|
|00000430| 50 72 69 6e 74 69 6e 67 | 20 20 43 72 61 66 74 73 |Printing| Crafts|
|00000440| 6d 61 6e 20 50 72 65 73 | 73 0d 46 69 6c 6d 20 50 |man Pres|s.Film P|
|00000450| 72 65 70 61 72 61 74 69 | 6f 6e 20 20 41 70 74 6f |reparati|on Apto|
|00000460| 73 20 50 6f 73 74 2c 20 | 49 6e 63 2e 0d 50 72 6f |s Post, |Inc..Pro|
|00000470| 64 75 63 74 69 6f 6e 20 | 20 50 72 65 50 72 65 73 |duction | PrePres|
|00000480| 73 20 41 73 73 65 6d 62 | 6c 79 0d 50 68 6f 74 6f |s Assemb|ly.Photo|
|00000490| 67 72 61 70 68 65 72 20 | 20 52 61 6c 70 68 20 50 |grapher | Ralph P|
|000004a0| 6f 72 74 69 6c 6c 6f 0d | 43 69 72 63 75 6c 61 74 |ortillo.|Circulat|
|000004b0| 69 6f 6e 20 4d 61 6e 61 | 67 65 6d 65 6e 74 20 20 |ion Mana|gement |
|000004c0| 44 61 76 69 64 20 57 69 | 6c 73 6f 6e 0d 4f 6e 6c |David Wi|lson.Onl|
|000004d0| 69 6e 65 20 50 72 6f 64 | 75 63 74 69 6f 6e 20 20 |ine Prod|uction |
|000004e0| 43 61 73 73 69 20 43 61 | 72 70 65 6e 74 65 72 2c |Cassi Ca|rpenter,|
|000004f0| 20 0d 09 46 6f 72 62 65 | 73 20 4d 69 6c 6c 20 50 | ..Forbe|s Mill P|
|00000500| 72 65 73 73 0d 09 0d 43 | 6c 65 6f 20 48 75 67 67 |ress...C|leo Hugg|
|00000510| 69 6e 73 20 63 72 65 61 | 74 65 64 20 74 68 69 73 |ins crea|ted this|
|00000520| 20 63 6f 76 65 72 20 77 | 69 74 68 0d 41 64 6f 62 | cover w|ith.Adob|
|00000530| 65 20 49 6c 6c 75 73 74 | 72 61 74 6f 72 a8 2e 20 |e Illust|rator.. |
|00000540| 41 20 74 68 65 6f 72 65 | 74 69 63 61 6c 20 4b 6c |A theore|tical Kl|
|00000550| 65 69 6e 0d 70 6c 61 6e | 65 20 77 61 73 20 63 68 |ein.plan|e was ch|
|00000560| 6f 73 65 6e 20 74 6f 20 | 72 65 70 72 65 73 65 6e |osen to |represen|
|00000570| 74 20 74 68 65 20 63 6f | 6d 70 6c 65 78 20 74 6f |t the co|mplex to|
|00000580| 70 6f 6c 6f 67 79 20 6f | 6e 20 77 68 69 63 68 20 |pology o|n which |
|00000590| 74 68 72 65 61 64 73 20 | 6f 66 0d 65 78 65 63 75 |threads |of.execu|
|000005a0| 74 69 6f 6e 20 6f 70 65 | 72 61 74 65 2e 0d 64 20 |tion ope|rate..d |
|000005b0| 65 20 76 20 65 20 6c 20 | 6f 20 70 2c 20 54 68 65 |e v e l |o p, The|
|000005c0| 20 41 70 70 6c 65 20 54 | 65 63 68 6e 69 63 61 6c | Apple T|echnical|
|000005d0| 0d 4a 6f 75 72 6e 61 6c | 2c 20 69 73 20 61 20 71 |.Journal|, is a q|
|000005e0| 75 61 72 74 65 72 6c 79 | 20 70 75 62 6c 69 63 61 |uarterly| publica|
|000005f0| 74 69 6f 6e 0d 6f 66 20 | 74 68 65 20 44 65 76 65 |tion.of |the Deve|
|00000600| 6c 6f 70 65 72 20 54 65 | 63 68 6e 69 63 61 6c 20 |loper Te|chnical |
|00000610| 43 6f 6d 6d 75 6e 69 63 | 61 74 69 6f 6e 73 20 67 |Communic|ations g|
|00000620| 72 6f 75 70 2e 0d 09 0d | 0d 09 09 45 20 44 20 49 |roup....|...E D I|
|00000630| 20 54 20 4f 20 52 20 49 | 20 41 20 4c 20 20 20 32 | T O R I| A L 2|
|00000640| 0d 09 09 4c 20 45 20 54 | 20 54 20 45 20 52 20 53 |...L E T| T E R S|
|00000650| 20 20 20 34 0d 09 09 41 | 20 52 20 54 20 49 20 43 | 4...A| R T I C|
|00000660| 20 4c 20 45 20 53 0d 09 | 43 4f 4e 54 45 4e 54 53 | L E S..|CONTENTS|
|00000670| 09 54 68 72 65 61 64 73 | 20 6f 6e 20 74 68 65 20 |.Threads| on the |
|00000680| 4d 61 63 69 6e 74 6f 73 | 68 20 20 62 79 20 4d 69 |Macintos|h by Mi|
|00000690| 63 68 61 65 6c 20 47 6f | 75 67 68 20 20 20 4d 75 |chael Go|ugh Mu|
|000006a0| 6c 74 69 70 6c 65 20 63 | 6f 6e 63 75 72 72 65 6e |ltiple c|oncurren|
|000006b0| 74 20 0d 74 68 72 65 61 | 64 73 20 6f 66 20 65 78 |t .threa|ds of ex|
|000006c0| 65 63 75 74 69 6f 6e 20 | 6f 6e 20 74 68 65 20 4d |ecution |on the M|
|000006d0| 61 63 69 6e 74 6f 73 68 | 3f 20 59 6f 75 20 62 65 |acintosh|? You be|
|000006e0| 74 21 20 54 68 69 73 20 | 61 72 74 69 63 6c 65 20 |t! This |article |
|000006f0| 70 72 65 73 65 6e 74 73 | 20 61 20 63 6f 6d 70 6c |presents| a compl|
|00000700| 65 74 65 20 74 68 72 65 | 61 64 73 20 70 61 63 6b |ete thre|ads pack|
|00000710| 61 67 65 2c 20 74 61 6c | 6b 73 20 61 62 6f 75 74 |age, tal|ks about|
|00000720| 20 69 74 73 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 | its imp|lementat|
|00000730| 69 6f 6e 2c 20 61 6e 64 | 20 73 68 6f 77 73 20 79 |ion, and| shows y|
|00000740| 6f 75 20 68 6f 77 20 74 | 6f 20 75 73 65 20 69 74 |ou how t|o use it|
|00000750| 2e 20 20 36 0d 09 09 51 | 75 69 63 6b 44 72 61 77 |. 6...Q|uickDraw|
|00000760| 27 73 20 43 6f 70 79 42 | 69 74 73 20 50 72 6f 63 |'s CopyB|its Proc|
|00000770| 65 64 75 72 65 3a 20 42 | 65 74 74 65 72 20 54 68 |edure: B|etter Th|
|00000780| 61 6e 20 45 76 65 72 20 | 69 6e 20 53 79 73 74 65 |an Ever |in Syste|
|00000790| 6d 20 37 2e 30 20 20 62 | 79 20 4b 6f 6e 73 74 61 |m 7.0 b|y Konsta|
|000007a0| 6e 74 69 6e 20 4f 74 68 | 6d 65 72 20 20 20 49 6e |ntin Oth|mer In|
|000007b0| 20 53 79 73 74 65 6d 20 | 37 2e 30 2c 20 74 68 65 | System |7.0, the|
|000007c0| 20 69 6e 74 65 72 6e 61 | 6c 20 77 6f 72 6b 69 6e | interna|l workin|
|000007d0| 67 73 20 6f 66 20 74 68 | 69 73 20 76 65 72 73 61 |gs of th|is versa|
|000007e0| 74 69 6c 65 20 72 6f 75 | 74 69 6e 65 20 68 61 76 |tile rou|tine hav|
|000007f0| 65 20 63 68 61 6e 67 65 | 64 20 28 66 6f 72 20 74 |e change|d (for t|
|00000800| 68 65 20 62 65 74 74 65 | 72 2c 20 6f 66 20 63 6f |he bette|r, of co|
|00000810| 75 72 73 65 21 29 2e 20 | 4c 65 61 72 6e 20 61 6c |urse!). |Learn al|
|00000820| 6c 20 61 62 6f 75 74 20 | 74 68 65 20 64 69 66 66 |l about |the diff|
|00000830| 65 72 65 6e 63 65 73 2c | 20 61 6e 64 20 63 68 65 |erences,| and che|
|00000840| 63 6b 20 6f 75 74 20 73 | 6f 6d 65 20 73 69 6d 70 |ck out s|ome simp|
|00000850| 6c 65 20 62 75 74 20 75 | 73 65 66 75 6c 20 69 6d |le but u|seful im|
|00000860| 61 67 65 20 70 72 6f 63 | 65 73 73 69 6e 67 20 74 |age proc|essing t|
|00000870| 65 63 68 6e 69 71 75 65 | 73 2e 20 20 32 33 0d 09 |echnique|s. 23..|
|00000880| 09 4d 61 63 54 43 50 20 | 43 6f 6f 6b 62 6f 6f 6b |.MacTCP |Cookbook|
|00000890| 3a 20 43 6f 6e 73 74 72 | 75 63 74 69 6e 67 20 4e |: Constr|ucting N|
|000008a0| 65 74 77 6f 72 6b 2d 41 | 77 61 72 65 20 41 70 70 |etwork-A|ware App|
|000008b0| 6c 69 63 61 74 69 6f 6e | 73 20 20 20 0d 62 79 20 |lication|s .by |
|000008c0| 53 74 65 76 65 20 46 61 | 6c 6b 65 6e 62 75 72 67 |Steve Fa|lkenburg|
|000008d0| 20 20 20 4e 65 74 77 6f | 72 6b 69 6e 67 20 66 6f | Netwo|rking fo|
|000008e0| 72 20 74 68 65 20 72 65 | 73 74 20 6f 66 20 75 73 |r the re|st of us|
|000008f0| 2e 20 48 65 72 65 27 73 | 20 61 6e 20 69 6e 74 72 |. Here's| an intr|
|00000900| 6f 64 75 63 74 69 6f 6e | 20 74 6f 20 74 68 65 20 |oduction| to the |
|00000910| 54 43 50 2f 49 50 20 70 | 72 6f 74 6f 63 6f 6c 20 |TCP/IP p|rotocol |
|00000920| 73 75 69 74 65 2c 20 61 | 6e 64 20 61 20 6c 69 62 |suite, a|nd a lib|
|00000930| 72 61 72 79 20 6f 66 20 | 72 6f 75 74 69 6e 65 73 |rary of |routines|
|00000940| 20 74 68 61 74 20 6d 61 | 6b 65 20 75 73 69 6e 67 | that ma|ke using|
|00000950| 20 4d 61 63 54 43 50 20 | 61 20 28 72 65 6c 61 74 | MacTCP |a (relat|
|00000960| 69 76 65 29 20 62 72 65 | 65 7a 65 2e 20 20 20 34 |ive) bre|eze. 4|
|00000970| 36 0d 09 09 43 20 4f 20 | 4c 20 55 20 4d 20 4e 20 |6...C O |L U M N |
|00000980| 53 0d 09 09 50 72 69 6e | 74 20 48 69 6e 74 73 20 |S...Prin|t Hints |
|00000990| 66 72 6f 6d 20 4c 75 6b | 65 20 26 20 5a 7a 3a 20 |from Luk|e & Zz: |
|000009a0| 43 6f 6c 6f 72 20 50 72 | 69 6e 74 69 6e 67 20 77 |Color Pr|inting w|
|000009b0| 69 74 68 20 4c 61 73 65 | 72 57 72 69 74 65 72 20 |ith Lase|rWriter |
|000009c0| 36 2e 30 20 52 65 76 69 | 73 69 74 65 64 20 20 62 |6.0 Revi|sited b|
|000009d0| 79 20 50 65 74 65 20 d2 | 4c 75 6b 65 d3 20 41 6c |y Pete .|Luke. Al|
|000009e0| 65 78 61 6e 64 65 72 20 | 20 20 41 20 70 6f 74 65 |exander | A pote|
|000009f0| 6e 74 69 61 6c 20 63 6f | 6c 6f 72 20 70 72 69 6e |ntial co|lor prin|
|00000a00| 74 69 6e 67 20 70 72 6f | 62 6c 65 6d 2c 20 0d 61 |ting pro|blem, .a|
|00000a10| 6e 64 20 73 6f 6d 65 20 | 73 6f 6c 75 74 69 6f 6e |nd some |solution|
|00000a20| 73 2e 20 41 6c 73 6f 20 | 73 68 61 72 6b 73 2c 20 |s. Also |sharks, |
|00000a30| 73 75 72 66 62 6f 61 72 | 64 73 2c 20 61 6e 64 20 |surfboar|ds, and |
|00000a40| 73 75 72 66 65 72 20 64 | 75 64 65 73 2e 20 20 20 |surfer d|udes. |
|00000a50| 34 34 0d 09 09 54 68 65 | 20 56 65 74 65 72 61 6e |44...The| Veteran|
|00000a60| 20 4e 65 6f 70 68 79 74 | 65 3a 20 41 20 46 61 6d | Neophyt|e: A Fam|
|00000a70| 69 6c 69 61 72 20 28 49 | 6e 74 65 72 29 66 61 63 |iliar (I|nter)fac|
|00000a80| 65 20 20 62 79 20 44 61 | 76 65 20 4a 6f 68 6e 73 |e by Da|ve Johns|
|00000a90| 6f 6e 20 20 20 43 68 65 | 72 6e 6f 66 66 20 66 61 |on Che|rnoff fa|
|00000aa0| 63 65 73 2c 20 6e 2d 64 | 69 6d 65 6e 73 69 6f 6e |ces, n-d|imension|
|00000ab0| 61 6c 20 70 6f 69 6e 74 | 73 2c 20 61 6e 64 20 73 |al point|s, and s|
|00000ac0| 69 6d 75 6c 61 74 69 6f | 6e 20 69 6e 20 74 68 65 |imulatio|n in the|
|00000ad0| 20 68 75 6d 61 6e 20 28 | 61 6e 64 20 63 61 6e 69 | human (|and cani|
|00000ae0| 6e 65 29 20 69 6e 74 65 | 72 66 61 63 65 2e 20 20 |ne) inte|rface. |
|00000af0| 20 37 30 0d 09 09 51 20 | 26 20 41 0d 09 09 41 6e | 70...Q |& A...An|
|00000b00| 73 77 65 72 73 20 74 6f | 20 79 6f 75 72 20 70 72 |swers to| your pr|
|00000b10| 6f 64 75 63 74 20 64 65 | 76 65 6c 6f 70 6d 65 6e |oduct de|velopmen|
|00000b20| 74 20 71 75 65 73 74 69 | 6f 6e 73 2e 0d 09 09 4d |t questi|ons....M|
|00000b30| 61 63 69 6e 74 6f 73 68 | 20 51 20 26 20 41 20 20 |acintosh| Q & A |
|00000b40| 20 37 32 0d 09 09 41 70 | 70 6c 65 20 49 49 20 51 | 72...Ap|ple II Q|
|00000b50| 20 26 20 41 20 20 20 38 | 30 0d 09 09 44 20 45 20 | & A 8|0...D E |
|00000b60| 56 20 45 20 4c 20 4f 20 | 50 20 45 20 52 20 20 20 |V E L O |P E R |
|00000b70| 45 20 53 20 53 20 45 20 | 4e 20 54 20 49 20 41 20 |E S S E |N T I A |
|00000b80| 4c 20 53 20 20 20 38 36 | 0d 09 09 41 20 64 65 73 |L S 86|...A des|
|00000b90| 63 72 69 70 74 69 6f 6e | 20 6f 66 20 77 68 61 74 |cription| of what|
|00000ba0| d5 73 20 6f 6c 64 20 61 | 6e 64 20 77 68 61 74 d5 |.s old a|nd what.|
|00000bb0| 73 20 6e 65 77 20 6f 6e | 20 79 6f 75 72 20 44 65 |s new on| your De|
|00000bc0| 76 65 6c 6f 70 65 72 20 | 45 73 73 65 6e 74 69 61 |veloper |Essentia|
|00000bd0| 6c 73 20 0d 43 44 2d 52 | 4f 4d 20 64 69 73 63 2e |ls .CD-R|OM disc.|
|00000be0| 20 43 6f 64 65 20 73 6e | 69 70 70 65 74 73 20 61 | Code sn|ippets a|
|00000bf0| 72 65 20 6e 65 77 d1 63 | 68 65 63 6b 20 d5 65 6d |re new.c|heck .em|
|00000c00| 20 6f 75 74 21 0d 09 09 | 49 20 4e 20 44 20 45 20 | out!...|I N D E |
|00000c10| 58 20 20 20 39 30 0d 45 | 44 49 54 4f 52 49 41 4c |X 90.E|DITORIAL|
|00000c20| 0d 4c 4f 55 45 4c 4c 41 | 20 50 49 5a 5a 55 54 49 |.LOUELLA| PIZZUTI|
|00000c30| 0d 50 41 53 53 45 53 20 | 54 4f 0d 43 41 52 4f 4c |.PASSES |TO.CAROL|
|00000c40| 49 4e 45 20 52 4f 53 45 | 0d 44 65 61 72 20 52 65 |INE ROSE|.Dear Re|
|00000c50| 61 64 65 72 73 2c 0d 53 | 74 61 72 74 69 6e 67 20 |aders,.S|tarting |
|00000c60| 77 69 74 68 20 74 68 69 | 73 20 69 73 73 75 65 20 |with thi|s issue |
|00000c70| 6f 66 20 64 65 76 65 6c | 6f 70 2c 20 4c 6f 75 65 |of devel|op, Loue|
|00000c80| 6c 6c 61 20 68 61 73 20 | 70 61 73 73 65 64 20 74 |lla has |passed t|
|00000c90| 68 65 20 65 64 69 74 6f | 72 69 61 6c 20 62 61 74 |he edito|rial bat|
|00000ca0| 6f 6e 20 74 6f 20 79 6f | 75 72 73 20 74 72 75 6c |on to yo|urs trul|
|00000cb0| 79 2c 20 43 61 72 6f 6c | 69 6e 65 20 52 6f 73 65 |y, Carol|ine Rose|
|00000cc0| 2e 20 49 66 20 74 68 65 | 20 6e 61 6d 65 20 73 6f |. If the| name so|
|00000cd0| 75 6e 64 73 20 66 61 6d | 69 6c 69 61 72 2c 20 69 |unds fam|iliar, i|
|00000ce0| 74 d5 73 20 62 65 63 61 | 75 73 65 20 79 6f 75 20 |t.s beca|use you |
|00000cf0| 6d 61 79 20 68 61 76 65 | 20 73 65 65 6e 20 69 74 |may have| seen it|
|00000d00| 20 69 6e 20 74 68 65 20 | 63 72 65 64 69 74 73 20 | in the |credits |
|00000d10| 66 6f 72 20 49 6e 73 69 | 64 65 20 4d 61 63 69 6e |for Insi|de Macin|
|00000d20| 74 6f 73 68 2c 20 56 6f | 6c 75 6d 65 73 20 49 2d |tosh, Vo|lumes I-|
|00000d30| 49 49 49 2e 20 41 74 20 | 6f 6e 65 20 70 6f 69 6e |III. At |one poin|
|00000d40| 74 20 64 75 72 69 6e 67 | 20 6d 79 20 74 68 72 65 |t during| my thre|
|00000d50| 65 2d 61 6e 64 2d 61 2d | 68 61 6c 66 2d 79 65 61 |e-and-a-|half-yea|
|00000d60| 72 20 73 74 69 6e 74 20 | 61 73 20 74 68 65 20 70 |r stint |as the p|
|00000d70| 72 69 6d 61 72 79 20 61 | 75 74 68 6f 72 20 61 6e |rimary a|uthor an|
|00000d80| 64 20 65 64 69 74 6f 72 | 20 6f 66 20 74 68 61 74 |d editor| of that|
|00000d90| 20 6d 61 67 6e 75 6d 20 | 6f 70 75 73 2c 20 49 20 | magnum |opus, I |
|00000da0| 69 6e 74 65 72 76 69 65 | 77 65 64 20 61 6e 20 69 |intervie|wed an i|
|00000db0| 6e 65 78 70 65 72 69 65 | 6e 63 65 64 20 62 75 74 |nexperie|nced but|
|00000dc0| 20 64 65 6c 69 67 68 74 | 66 75 6c 6c 79 20 63 6f | delight|fully co|
|00000dd0| 63 6b 79 20 79 6f 75 6e | 67 20 77 6f 6d 61 6e 20 |cky youn|g woman |
|00000de0| 77 68 6f 20 63 6f 6e 76 | 69 6e 63 65 64 20 6d 65 |who conv|inced me|
|00000df0| 20 74 68 61 74 20 73 68 | 65 20 63 6f 75 6c 64 20 | that sh|e could |
|00000e00| 64 6f 20 61 73 20 67 6f | 6f 64 20 61 20 6a 6f 62 |do as go|od a job|
|00000e10| 20 61 73 20 61 6e 79 6f | 6e 65 20 6f 66 20 66 6f | as anyo|ne of fo|
|00000e20| 72 6d 61 74 74 69 6e 67 | 20 74 68 65 20 49 4d 20 |rmatting| the IM |
|00000e30| 66 69 6c 65 73 20 6f 6e | 20 74 68 65 20 4d 61 63 |files on| the Mac|
|00000e40| 69 6e 74 6f 73 68 a8 20 | 28 74 68 65 79 20 77 65 |intosh. |(they we|
|00000e50| 72 65 20 63 72 65 61 74 | 65 64 20 6f 6e 20 74 68 |re creat|ed on th|
|00000e60| 65 20 41 70 70 6c 65 a8 | 20 49 49 49 29 2e 20 20 |e Apple.| III). |
|00000e70| 53 68 65 20 77 61 73 20 | 68 69 72 65 64 2c 20 61 |She was |hired, a|
|00000e80| 6e 64 20 65 6e 64 65 64 | 20 75 70 20 62 65 69 6e |nd ended| up bein|
|00000e90| 67 20 61 20 67 72 65 61 | 74 20 68 65 6c 70 20 74 |g a grea|t help t|
|00000ea0| 6f 20 74 68 65 20 70 72 | 6f 6a 65 63 74 20 61 73 |o the pr|oject as|
|00000eb0| 20 77 65 6c 6c 20 61 73 | 20 61 20 67 72 65 61 74 | well as| a great|
|00000ec0| 20 66 72 69 65 6e 64 2e | 20 59 6f 75 d5 6c 6c 20 | friend.| You.ll |
|00000ed0| 61 6c 73 6f 20 66 69 6e | 64 20 68 65 72 20 6e 61 |also fin|d her na|
|00000ee0| 6d 65 20 69 6e 20 74 68 | 65 20 63 72 65 64 69 74 |me in th|e credit|
|00000ef0| 73 3a 20 d2 61 73 73 69 | 73 74 65 64 20 62 79 d3 |s: .assi|sted by.|
|00000f00| 20 6e 6f 6e 65 20 6f 74 | 68 65 72 20 74 68 61 6e | none ot|her than|
|00000f10| 20 4c 6f 75 65 6c 6c 61 | 20 50 69 7a 7a 75 74 69 | Louella| Pizzuti|
|00000f20| 2e 0d 42 75 74 20 74 68 | 65 20 74 69 6d 65 20 63 |..But th|e time c|
|00000f30| 61 6d 65 20 66 6f 72 20 | 6d 65 20 74 6f 20 6d 6f |ame for |me to mo|
|00000f40| 76 65 20 6f 6e 2e 20 49 | 20 77 65 6e 74 20 6c 6f |ve on. I| went lo|
|00000f50| 6f 6b 69 6e 67 20 66 6f | 72 20 6a 6f 62 73 20 61 |oking fo|r jobs a|
|00000f60| 6e 64 20 66 6f 75 6e 64 | 20 74 68 65 20 6e 65 78 |nd found| the nex|
|00000f70| 74 20 63 6f 6d 70 61 6e | 79 20 49 20 77 6f 75 6c |t compan|y I woul|
|00000f80| 64 20 77 6f 72 6b 20 66 | 6f 72 20 28 70 75 6e 73 |d work f|or (puns|
|00000f90| 20 69 6e 74 65 6e 64 65 | 64 29 2e 20 41 66 74 65 | intende|d). Afte|
|00000fa0| 72 20 66 6f 75 72 20 79 | 65 61 72 73 20 61 73 20 |r four y|ears as |
|00000fb0| 74 68 61 74 20 6e 65 78 | 74 20 63 6f 6d 70 61 6e |that nex|t compan|
|00000fc0| 79 d5 73 20 4d 61 6e 61 | 67 65 72 20 6f 66 20 50 |y.s Mana|ger of P|
|00000fd0| 75 62 6c 69 63 61 74 69 | 6f 6e 73 20 61 6e 64 20 |ublicati|ons and |
|00000fe0| 61 20 79 65 61 72 20 61 | 73 20 69 74 73 20 45 64 |a year a|s its Ed|
|00000ff0| 69 74 6f 72 20 69 6e 20 | 43 68 69 65 66 2c 20 49 |itor in |Chief, I|
|00001000| 20 77 61 73 20 72 65 61 | 64 79 20 74 6f 20 6d 6f | was rea|dy to mo|
|00001010| 76 65 20 6f 6e 20 61 67 | 61 69 6e 2e 20 49 20 70 |ve on ag|ain. I p|
|00001020| 75 74 20 74 68 65 20 77 | 6f 72 64 20 6f 75 74 20 |ut the w|ord out |
|00001030| 61 74 20 41 70 70 6c 65 | 20 61 6e 64 20 67 6f 74 |at Apple| and got|
|00001040| 20 61 20 70 68 6f 6e 65 | 20 63 61 6c 6c 20 66 72 | a phone| call fr|
|00001050| 6f 6d 20 4c 6f 75 65 6c | 6c 61 2c 20 77 69 74 68 |om Louel|la, with|
|00001060| 20 77 68 6f 6d 20 49 20 | 68 61 64 20 66 61 6c 6c | whom I |had fall|
|00001070| 65 6e 20 77 6f 65 66 75 | 6c 6c 79 20 6f 75 74 20 |en woefu|lly out |
|00001080| 6f 66 20 74 6f 75 63 68 | 20 6f 76 65 72 20 74 68 |of touch| over th|
|00001090| 65 20 79 65 61 72 73 2e | 20 4e 6f 77 20 74 68 65 |e years.| Now the|
|000010a0| 20 66 72 69 65 6e 64 73 | 68 69 70 20 68 61 73 20 | friends|hip has |
|000010b0| 62 65 65 6e 20 72 65 6e | 65 77 65 64 20 61 6e 64 |been ren|ewed and|
|000010c0| 20 77 65 d5 72 65 20 77 | 6f 72 6b 69 6e 67 20 74 | we.re w|orking t|
|000010d0| 6f 67 65 74 68 65 72 20 | 6f 6e 63 65 20 61 67 61 |ogether |once aga|
|000010e0| 69 6e d1 74 68 69 73 20 | 74 69 6d 65 20 77 69 74 |in.this |time wit|
|000010f0| 68 20 68 65 72 20 61 73 | 20 6d 79 20 62 6f 73 73 |h her as| my boss|
|00001100| 21 0d 41 66 74 65 72 20 | 61 20 62 72 69 65 66 20 |!.After |a brief |
|00001110| 6f 72 69 65 6e 74 61 74 | 69 6f 6e 20 28 61 6e 64 |orientat|ion (and|
|00001120| 20 61 20 77 6f 6e 64 65 | 72 66 75 6c 20 d2 77 65 | a wonde|rful .we|
|00001130| 6c 63 6f 6d 65 d3 20 6c | 75 6e 63 68 29 20 6f 6e |lcome. l|unch) on|
|00001140| 20 6d 79 20 66 69 72 73 | 74 20 64 61 79 20 62 61 | my firs|t day ba|
|00001150| 63 6b 20 61 74 20 41 70 | 70 6c 65 2c 20 49 20 77 |ck at Ap|ple, I w|
|00001160| 61 73 20 73 74 65 65 72 | 65 64 20 69 6e 74 6f 20 |as steer|ed into |
|00001170| 61 20 6d 65 65 74 69 6e | 67 20 61 74 20 77 68 69 |a meetin|g at whi|
|00001180| 63 68 20 49 20 68 61 64 | 20 74 6f 20 69 6d 6d 65 |ch I had| to imme|
|00001190| 64 69 61 74 65 6c 79 20 | 6d 61 6b 65 20 6d 79 20 |diately |make my |
|000011a0| 66 69 72 73 74 20 64 65 | 63 69 73 69 6f 6e 20 61 |first de|cision a|
|000011b0| 73 20 64 65 76 65 6c 6f | 70 d5 73 20 6e 65 77 20 |s develo|p.s new |
|000011c0| 45 64 69 74 6f 72 20 69 | 6e 20 43 68 69 65 66 2e |Editor i|n Chief.|
|000011d0| 20 41 63 74 75 61 6c 6c | 79 2c 20 69 74 20 77 61 | Actuall|y, it wa|
|000011e0| 73 20 73 6f 72 74 20 6f | 66 20 61 20 74 72 69 63 |s sort o|f a tric|
|000011f0| 6b 20 71 75 65 73 74 69 | 6f 6e 2c 20 73 69 6e 63 |k questi|on, sinc|
|00001200| 65 20 65 76 65 72 79 6f | 6e 65 20 70 72 65 73 65 |e everyo|ne prese|
|00001210| 6e 74 20 68 61 64 20 61 | 6c 72 65 61 64 79 20 61 |nt had a|lready a|
|00001220| 67 72 65 65 64 20 6f 6e | 20 74 68 65 20 61 6e 73 |greed on| the ans|
|00001230| 77 65 72 2e 20 46 6f 72 | 74 75 6e 61 74 65 6c 79 |wer. For|tunately|
|00001240| 2c 20 49 20 77 61 73 20 | 6f 66 20 6c 69 6b 65 20 |, I was |of like |
|00001250| 6d 69 6e 64 2c 20 61 6e | 64 20 61 73 20 61 20 72 |mind, an|d as a r|
|00001260| 65 73 75 6c 74 20 77 65 | d5 72 65 20 63 61 6c 6c |esult we|.re call|
|00001270| 69 6e 67 20 74 68 69 73 | 20 73 69 6d 70 6c 79 20 |ing this| simply |
|00001280| 49 73 73 75 65 20 36 20 | 72 61 74 68 65 72 20 74 |Issue 6 |rather t|
|00001290| 68 61 6e 20 63 6f 6e 74 | 69 6e 75 65 20 77 69 74 |han cont|inue wit|
|000012a0| 68 20 74 68 65 20 70 72 | 65 76 69 6f 75 73 20 69 |h the pr|evious i|
|000012b0| 73 73 75 65 d5 73 20 75 | 73 65 20 6f 66 20 d2 56 |ssue.s u|se of .V|
|000012c0| 6f 6c 75 6d 65 20 32 d3 | 20 28 77 68 69 63 68 20 |olume 2.| (which |
|000012d0| 73 6e 75 63 6b 20 69 6e | 20 77 68 69 6c 65 20 4c |snuck in| while L|
|000012e0| 6f 75 65 6c 6c 61 20 77 | 61 73 20 6f 75 74 20 77 |ouella w|as out w|
|000012f0| 69 74 68 20 61 20 62 61 | 64 20 62 61 63 6b 29 2e |ith a ba|d back).|
|00001300| 20 53 6f 20 66 6f 72 20 | 74 68 6f 73 65 20 6f 66 | So for |those of|
|00001310| 20 79 6f 75 20 77 68 6f | 20 61 72 65 20 63 6f 6c | you who| are col|
|00001320| 6c 65 63 74 69 6e 67 20 | 74 68 65 20 77 68 6f 6c |lecting |the whol|
|00001330| 65 20 73 65 74 20 28 6b | 6e 6f 77 69 6e 67 20 69 |e set (k|nowing i|
|00001340| 74 20 77 69 6c 6c 20 62 | 65 20 6f 66 20 69 6e 65 |t will b|e of ine|
|00001350| 73 74 69 6d 61 62 6c 65 | 20 76 61 6c 75 65 20 73 |stimable| value s|
|00001360| 6f 6d 65 64 61 79 29 2c | 20 74 61 6b 65 20 6e 6f |omeday),| take no|
|00001370| 74 65 20 74 68 61 74 20 | 74 68 65 20 70 72 65 76 |te that |the prev|
|00001380| 69 6f 75 73 20 69 73 73 | 75 65 d5 73 20 6e 75 6d |ious iss|ue.s num|
|00001390| 62 65 72 20 73 68 6f 75 | 6c 64 20 62 65 20 72 65 |ber shou|ld be re|
|000013a0| 61 73 73 69 67 6e 65 64 | 20 61 63 63 6f 72 64 69 |assigned| accordi|
|000013b0| 6e 67 20 74 6f 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |ng to th|e follow|
|000013c0| 69 6e 67 20 66 6f 72 6d | 75 6c 61 3a 0d 69 6e 74 |ing form|ula:.int|
|000013d0| 0d 43 61 6c 63 75 6c 61 | 74 65 49 73 73 75 65 4e |.Calcula|teIssueN|
|000013e0| 75 6d 62 65 72 28 69 6e | 74 20 56 6f 6c 75 6d 65 |umber(in|t Volume|
|000013f0| 2c 20 69 6e 74 20 49 73 | 73 75 65 29 0d 7b 0d 09 |, int Is|sue).{..|
|00001400| 72 65 74 75 72 6e 20 28 | 28 56 6f 6c 75 6d 65 20 |return (|(Volume |
|00001410| d0 20 31 29 20 2a 20 34 | 29 20 2b 20 49 73 73 75 |. 1) * 4|) + Issu|
|00001420| 65 3b 0d 7d 0d 0d 0d 4f | 72 2c 20 66 6f 72 20 79 |e;.}...O|r, for y|
|00001430| 6f 75 20 50 61 73 63 61 | 6c 20 74 79 70 65 73 3a |ou Pasca|l types:|
|00001440| 0d 46 55 4e 43 54 49 4f | 4e 20 43 61 6c 63 75 6c |.FUNCTIO|N Calcul|
|00001450| 61 74 65 49 73 73 75 65 | 4e 75 6d 62 65 72 20 28 |ateIssue|Number (|
|00001460| 56 6f 6c 75 6d 65 2c 20 | 49 73 73 75 65 3a 20 49 |Volume, |Issue: I|
|00001470| 4e 54 45 47 45 52 29 3a | 20 49 4e 54 45 47 45 52 |NTEGER):| INTEGER|
|00001480| 3b 0d 42 45 47 49 4e 0d | 20 09 43 61 6c 63 75 6c |;.BEGIN.| .Calcul|
|00001490| 61 74 65 49 73 73 75 65 | 4e 75 6d 62 65 72 20 3a |ateIssue|Number :|
|000014a0| 3d 20 28 28 56 6f 6c 75 | 6d 65 20 2d 20 31 29 20 |= ((Volu|me - 1) |
|000014b0| 2a 20 34 29 20 2b 20 49 | 73 73 75 65 3b 0d 45 4e |* 4) + I|ssue;.EN|
|000014c0| 44 3b 0d 59 6f 75 20 6d | 61 79 20 6e 6f 74 69 63 |D;.You m|ay notic|
|000014d0| 65 20 6f 74 68 65 72 20 | 63 68 61 6e 67 65 73 20 |e other |changes |
|000014e0| 69 6e 74 72 6f 64 75 63 | 65 64 20 69 6e 20 74 68 |introduc|ed in th|
|000014f0| 69 73 20 69 73 73 75 65 | 2e 20 57 65 20 68 6f 70 |is issue|. We hop|
|00001500| 65 20 79 6f 75 d5 6c 6c | 20 61 67 72 65 65 20 74 |e you.ll| agree t|
|00001510| 68 65 79 d5 72 65 20 63 | 68 61 6e 67 65 73 20 66 |hey.re c|hanges f|
|00001520| 6f 72 20 74 68 65 20 62 | 65 74 74 65 72 3b 20 69 |or the b|etter; i|
|00001530| 66 20 6e 6f 74 2c 20 62 | 65 20 73 75 72 65 20 74 |f not, b|e sure t|
|00001540| 6f 20 6c 65 74 20 75 73 | 20 6b 6e 6f 77 2e 20 50 |o let us| know. P|
|00001550| 6c 65 61 73 65 20 61 6c | 73 6f 20 6c 65 74 20 75 |lease al|so let u|
|00001560| 73 20 6b 6e 6f 77 20 69 | 66 20 79 6f 75 d5 64 20 |s know i|f you.d |
|00001570| 62 65 20 69 6e 74 65 72 | 65 73 74 65 64 20 69 6e |be inter|ested in|
|00001580| 20 77 72 69 74 69 6e 67 | 20 61 6e 20 61 72 74 69 | writing| an arti|
|00001590| 63 6c 65 20 66 6f 72 20 | 64 65 76 65 6c 6f 70 20 |cle for |develop |
|000015a0| 79 6f 75 72 73 65 6c 66 | 2e 20 44 6f 20 79 6f 75 |yourself|. Do you|
|000015b0| 20 68 61 76 65 20 61 6e | 79 20 6e 69 66 74 79 20 | have an|y nifty |
|000015c0| 63 6f 64 65 20 79 6f 75 | d5 64 20 6c 69 6b 65 20 |code you|.d like |
|000015d0| 74 6f 20 73 68 61 72 65 | 20 77 69 74 68 20 74 68 |to share| with th|
|000015e0| 65 20 72 65 73 74 20 6f | 66 20 74 68 65 20 41 70 |e rest o|f the Ap|
|000015f0| 70 6c 65 20 64 65 76 65 | 6c 6f 70 65 72 20 77 6f |ple deve|loper wo|
|00001600| 72 6c 64 3f 20 48 61 76 | 65 20 79 6f 75 20 79 65 |rld? Hav|e you ye|
|00001610| 61 72 6e 65 64 20 74 6f | 20 68 61 76 65 20 79 6f |arned to| have yo|
|00001620| 75 72 20 6f 77 6e 20 73 | 69 6c 6c 79 20 62 69 6f |ur own s|illy bio|
|00001630| 20 67 72 61 63 65 20 74 | 68 65 73 65 20 70 61 67 | grace t|hese pag|
|00001640| 65 73 20 28 6e 6f 74 20 | 74 6f 20 6d 65 6e 74 69 |es (not |to menti|
|00001650| 6f 6e 20 79 6f 75 72 20 | 70 68 6f 74 6f 29 3f 20 |on your |photo)? |
|00001660| 54 68 69 6e 6b 20 6f 66 | 20 68 6f 77 20 70 6c 65 |Think of| how ple|
|00001670| 61 73 65 64 20 79 6f 75 | 72 20 6d 6f 74 68 65 72 |ased you|r mother|
|00001680| 20 77 6f 75 6c 64 20 62 | 65 20 74 6f 20 72 65 63 | would b|e to rec|
|00001690| 65 69 76 65 20 61 20 63 | 6f 70 79 2e 0d 49 d5 6c |eive a c|opy..I.l|
|000016a0| 6c 20 6c 65 61 76 65 20 | 79 6f 75 20 77 69 74 68 |l leave |you with|
|000016b0| 20 61 20 72 69 64 64 6c | 65 3a 20 49 20 65 6e 74 | a riddl|e: I ent|
|000016c0| 65 72 65 64 20 74 68 69 | 73 20 65 6e 74 69 72 65 |ered thi|s entire|
|000016d0| 20 65 64 69 74 6f 72 69 | 61 6c 20 77 69 74 68 6f | editori|al witho|
|000016e0| 75 74 20 70 72 65 73 73 | 69 6e 67 20 61 20 73 69 |ut press|ing a si|
|000016f0| 6e 67 6c 65 20 6b 65 79 | 20 6f 6e 20 74 68 65 20 |ngle key| on the |
|00001700| 6b 65 79 62 6f 61 72 64 | 20 6f 72 20 63 6c 69 63 |keyboard| or clic|
|00001710| 6b 69 6e 67 20 74 68 65 | 20 6d 6f 75 73 65 20 62 |king the| mouse b|
|00001720| 75 74 74 6f 6e 2e 20 49 | 20 77 61 73 20 61 73 20 |utton. I| was as |
|00001730| 71 75 69 65 74 20 61 73 | 20 61 20 6d 6f 75 73 65 |quiet as| a mouse|
|00001740| 20 28 74 68 65 20 66 75 | 72 72 79 20 6b 69 6e 64 | (the fu|rry kind|
|00001750| 29 2e 20 48 6f 77 20 64 | 69 64 20 49 20 64 6f 20 |). How d|id I do |
|00001760| 74 68 69 73 3f 20 41 6e | 64 20 66 75 72 74 68 65 |this? An|d furthe|
|00001770| 72 6d 6f 72 65 2c 20 77 | 68 79 3f 20 53 74 61 79 |rmore, w|hy? Stay|
|00001780| 20 74 75 6e 65 64 20 66 | 6f 72 20 74 68 65 20 61 | tuned f|or the a|
|00001790| 6e 73 77 65 72 20 69 6e | 20 6f 75 72 20 6e 65 78 |nswer in| our nex|
|000017a0| 74 20 69 73 73 75 65 2e | 0d 43 61 72 6f 6c 69 6e |t issue.|.Carolin|
|000017b0| 65 20 52 6f 73 65 0d 45 | 64 69 74 6f 72 0d 4c 45 |e Rose.E|ditor.LE|
|000017c0| 54 54 45 52 53 0d a5 49 | 20 65 6e 63 6f 75 6e 74 |TTERS..I| encount|
|000017d0| 65 72 65 64 20 61 20 74 | 65 63 68 6e 69 63 61 6c |ered a t|echnical|
|000017e0| 20 65 72 72 6f 72 20 69 | 6e 20 74 68 65 20 4d 61 | error i|n the Ma|
|000017f0| 63 69 6e 74 6f 73 68 20 | 51 20 26 20 41 20 73 65 |cintosh |Q & A se|
|00001800| 63 74 69 6f 6e 20 69 6e | 20 74 68 65 20 6c 61 74 |ction in| the lat|
|00001810| 65 73 74 20 69 73 73 75 | 65 20 6f 66 20 64 65 76 |est issu|e of dev|
|00001820| 65 6c 6f 70 2e 20 54 68 | 65 20 71 75 65 73 74 69 |elop. Th|e questi|
|00001830| 6f 6e 20 77 61 73 3a 20 | d2 49 73 20 74 68 65 20 |on was: |.Is the |
|00001840| 6d 61 78 69 6d 75 6d 20 | 73 69 7a 65 20 66 6f 72 |maximum |size for|
|00001850| 20 67 6c 6f 62 61 6c 20 | 61 6e 64 20 6c 6f 63 61 | global |and loca|
|00001860| 6c 20 64 61 74 61 20 73 | 74 69 6c 6c 20 33 32 4b |l data s|till 32K|
|00001870| 3f d3 20 54 68 65 20 61 | 6e 73 77 65 72 20 73 74 |?. The a|nswer st|
|00001880| 61 74 65 64 20 74 68 61 | 74 20 74 68 65 20 33 32 |ated tha|t the 32|
|00001890| 4b 20 6c 69 6d 69 74 20 | 66 6f 72 20 6c 6f 63 61 |K limit |for loca|
|000018a0| 6c 20 28 73 74 61 63 6b | 29 20 64 61 74 61 20 d2 |l (stack|) data .|
|000018b0| 69 73 20 62 61 73 69 63 | 61 6c 6c 79 20 64 75 65 |is basic|ally due|
|000018c0| 20 74 6f 20 74 68 65 20 | 4d 6f 74 6f 72 6f 6c 61 | to the |Motorola|
|000018d0| 20 70 72 6f 63 65 73 73 | 6f 72 20 61 72 63 68 69 | process|or archi|
|000018e0| 74 65 63 74 75 72 65 2e | d3 20 41 73 20 73 74 61 |tecture.|. As sta|
|000018f0| 74 65 64 20 69 6e 20 74 | 68 65 20 61 6e 73 77 65 |ted in t|he answe|
|00001900| 72 2c 20 74 68 65 20 4c | 49 4e 4b 20 69 6e 73 74 |r, the L|INK inst|
|00001910| 72 75 63 74 69 6f 6e 20 | 69 73 20 6c 69 6d 69 74 |ruction |is limit|
|00001920| 65 64 20 74 6f 20 61 20 | 31 36 2d 62 69 74 20 6f |ed to a |16-bit o|
|00001930| 66 66 73 65 74 2e 20 55 | 6e 73 74 61 74 65 64 20 |ffset. U|nstated |
|00001940| 69 6e 20 74 68 65 20 61 | 6e 73 77 65 72 20 69 73 |in the a|nswer is|
|00001950| 20 74 68 61 74 20 74 68 | 65 20 63 6f 6d 70 69 6c | that th|e compil|
|00001960| 65 72 20 63 61 6e 20 65 | 61 73 69 6c 79 20 77 6f |er can e|asily wo|
|00001970| 72 6b 20 61 72 6f 75 6e | 64 20 74 68 69 73 20 6c |rk aroun|d this l|
|00001980| 69 6d 69 74 61 74 69 6f | 6e 2e 20 53 75 70 70 6f |imitatio|n. Suppo|
|00001990| 73 65 20 79 6f 75 72 20 | 70 72 6f 67 72 61 6d 20 |se your |program |
|000019a0| 64 65 63 6c 61 72 65 73 | 20 35 30 4b 20 62 79 74 |declares| 50K byt|
|000019b0| 65 73 20 6f 66 20 6c 6f | 63 61 6c 20 64 61 74 61 |es of lo|cal data|
|000019c0| 2e 20 54 68 65 20 63 6f | 6d 70 69 6c 65 72 20 73 |. The co|mpiler s|
|000019d0| 68 6f 75 6c 64 20 67 65 | 6e 65 72 61 74 65 20 61 |hould ge|nerate a|
|000019e0| 20 4c 49 4e 4b 20 69 6e | 73 74 72 75 63 74 69 6f | LINK in|structio|
|000019f0| 6e 20 66 6f 72 20 74 68 | 65 20 66 69 72 73 74 20 |n for th|e first |
|00001a00| 33 32 4b 20 62 79 74 65 | 73 20 61 6e 64 20 74 68 |32K byte|s and th|
|00001a10| 65 6e 20 61 64 6a 75 73 | 74 20 74 68 65 20 73 74 |en adjus|t the st|
|00001a20| 61 63 6b 20 66 6f 72 20 | 74 68 65 20 72 65 6d 61 |ack for |the rema|
|00001a30| 69 6e 69 6e 67 20 31 38 | 4b 20 62 79 74 65 73 20 |ining 18|K bytes |
|00001a40| 6e 65 65 64 65 64 20 62 | 79 20 74 68 65 20 72 6f |needed b|y the ro|
|00001a50| 75 74 69 6e 65 2e 20 49 | 66 20 74 68 65 20 70 72 |utine. I|f the pr|
|00001a60| 6f 67 72 61 6d 20 69 73 | 20 63 6f 6d 70 69 6c 65 |ogram is| compile|
|00001a70| 64 20 73 70 65 63 69 66 | 69 63 61 6c 6c 79 20 66 |d specif|ically f|
|00001a80| 6f 72 20 74 68 65 20 36 | 38 30 32 30 20 6f 72 20 |or the 6|8020 or |
|00001a90| 36 38 30 33 30 2c 20 74 | 68 65 20 63 6f 6d 70 69 |68030, t|he compi|
|00001aa0| 6c 65 72 20 63 61 6e 20 | 69 73 73 75 65 20 61 20 |ler can |issue a |
|00001ab0| 4c 49 4e 4b 4c 20 28 6c | 69 6e 6b 20 6c 6f 6e 67 |LINKL (l|ink long|
|00001ac0| 29 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 2c 20 77 |) instru|ction, w|
|00001ad0| 68 69 63 68 20 61 6c 6c | 6f 77 73 20 61 20 66 75 |hich all|ows a fu|
|00001ae0| 6c 6c 20 33 32 2d 62 69 | 74 20 6f 66 66 73 65 74 |ll 32-bi|t offset|
|00001af0| 2e 0d d1 43 68 75 63 6b | 20 4c 69 6e 73 0d 54 68 |...Chuck| Lins.Th|
|00001b00| 61 6e 6b 73 20 66 6f 72 | 20 74 68 65 20 63 6c 61 |anks for| the cla|
|00001b10| 72 69 66 69 63 61 74 69 | 6f 6e 2e 20 59 6f 75 d5 |rificati|on. You.|
|00001b20| 72 65 20 61 62 73 6f 6c | 75 74 65 6c 79 20 72 69 |re absol|utely ri|
|00001b30| 67 68 74 2c 20 62 75 74 | 20 6f 66 20 63 6f 75 72 |ght, but| of cour|
|00001b40| 73 65 20 66 6f 72 20 6d | 6f 73 74 20 6f 66 20 75 |se for m|ost of u|
|00001b50| 73 20 69 74 20 64 6f 65 | 73 6e d5 74 20 6d 61 6b |s it doe|sn.t mak|
|00001b60| 65 20 61 6e 79 20 64 69 | 66 66 65 72 65 6e 63 65 |e any di|fference|
|00001b70| 3b 20 77 65 20 64 6f 6e | d5 74 20 77 72 69 74 65 |; we don|.t write|
|00001b80| 20 6f 75 72 20 63 6f 6d | 70 69 6c 65 72 73 2c 20 | our com|pilers, |
|00001b90| 77 65 d5 72 65 20 73 6c | 61 76 65 73 20 74 6f 20 |we.re sl|aves to |
|00001ba0| 74 68 65 6d 2e 20 49 20 | 67 75 65 73 73 20 74 68 |them. I |guess th|
|00001bb0| 65 20 61 6e 73 77 65 72 | 20 73 68 6f 75 6c 64 20 |e answer| should |
|00001bc0| 68 61 76 65 20 72 65 61 | 64 20 d2 69 73 20 62 61 |have rea|d .is ba|
|00001bd0| 73 69 63 61 6c 6c 79 20 | 64 75 65 20 74 6f 20 74 |sically |due to t|
|00001be0| 68 65 20 77 61 79 20 74 | 68 61 74 20 63 75 72 72 |he way t|hat curr|
|00001bf0| 65 6e 74 20 63 6f 6d 70 | 69 6c 65 72 73 20 68 61 |ent comp|ilers ha|
|00001c00| 6e 64 6c 65 20 6c 6f 63 | 61 6c 20 64 61 74 61 2e |ndle loc|al data.|
|00001c10| d3 20 41 6c 6c 20 79 6f | 75 20 61 73 70 69 72 69 |. All yo|u aspiri|
|00001c20| 6e 67 20 63 6f 6d 70 69 | 6c 65 72 20 77 72 69 74 |ng compi|ler writ|
|00001c30| 65 72 73 2c 20 74 61 6b | 65 20 6e 6f 74 65 2e 0d |ers, tak|e note..|
|00001c40| d1 44 61 76 65 20 4a 6f | 68 6e 73 6f 6e 0d a5 41 |.Dave Jo|hnson..A|
|00001c50| 66 74 65 72 20 72 65 63 | 65 69 76 69 6e 67 20 47 |fter rec|eiving G|
|00001c60| 6f 72 69 6c 6c 61 73 20 | 69 6e 20 74 68 65 20 44 |orillas |in the D|
|00001c70| 69 73 63 20 28 44 65 76 | 65 6c 6f 70 65 72 20 43 |isc (Dev|eloper C|
|00001c80| 44 20 53 65 72 69 65 73 | 20 56 6f 6c 75 6d 65 20 |D Series| Volume |
|00001c90| 56 49 29 20 61 20 66 65 | 77 20 6d 6f 6e 74 68 73 |VI) a fe|w months|
|00001ca0| 20 61 67 6f 2c 20 49 20 | 63 68 65 63 6b 65 64 20 | ago, I |checked |
|00001cb0| 6f 75 74 20 74 68 65 20 | 65 6c 65 63 74 72 6f 6e |out the |electron|
|00001cc0| 69 63 20 76 65 72 73 69 | 6f 6e 73 20 6f 66 20 74 |ic versi|ons of t|
|00001cd0| 68 65 20 64 65 76 65 6c | 6f 70 20 69 73 73 75 65 |he devel|op issue|
|00001ce0| 73 20 74 68 61 74 20 77 | 65 20 64 69 64 20 6e 6f |s that w|e did no|
|00001cf0| 74 20 68 61 76 65 20 69 | 6e 20 68 61 72 64 63 6f |t have i|n hardco|
|00001d00| 70 79 2c 20 61 6e 64 20 | 63 61 6d 65 20 61 63 72 |py, and |came acr|
|00001d10| 6f 73 73 20 73 6f 6d 65 | 74 68 69 6e 67 20 74 68 |oss some|thing th|
|00001d20| 61 74 20 70 72 6f 6d 70 | 74 65 64 20 6d 65 20 74 |at promp|ted me t|
|00001d30| 6f 20 77 72 69 74 65 2e | 20 49 20 77 61 73 20 72 |o write.| I was r|
|00001d40| 65 61 64 69 6e 67 20 74 | 68 65 20 6c 65 74 74 65 |eading t|he lette|
|00001d50| 72 73 20 69 6e 20 64 65 | 76 65 6c 6f 70 20 49 73 |rs in de|velop Is|
|00001d60| 73 75 65 20 32 20 28 41 | 70 72 69 6c 20 31 39 39 |sue 2 (A|pril 199|
|00001d70| 30 29 20 61 6e 64 20 73 | 61 77 20 61 20 6c 65 74 |0) and s|aw a let|
|00001d80| 74 65 72 20 61 6e 64 20 | 72 65 73 70 6f 6e 73 65 |ter and |response|
|00001d90| 20 69 6e 20 77 68 69 63 | 68 20 79 6f 75 20 6d 65 | in whic|h you me|
|00001da0| 6e 74 69 6f 6e 65 64 20 | 74 68 65 20 d2 65 76 65 |ntioned |the .eve|
|00001db0| 72 2d 70 6f 70 75 6c 61 | 72 20 61 75 64 69 6f 20 |r-popula|r audio |
|00001dc0| 74 72 61 63 6b d3 20 66 | 72 6f 6d 20 74 68 65 20 |track. f|rom the |
|00001dd0| 64 65 76 65 6c 6f 70 20 | 43 44 2e 20 42 65 63 61 |develop |CD. Beca|
|00001de0| 75 73 65 20 09 77 65 20 | 61 72 65 20 61 6e 20 41 |use .we |are an A|
|00001df0| 70 70 6c 65 20 50 61 72 | 74 6e 65 72 2c 20 6f 75 |pple Par|tner, ou|
|00001e00| 72 20 63 6f 70 79 20 6f | 66 20 64 65 76 65 6c 6f |r copy o|f develo|
|00001e10| 70 20 63 6f 6e 74 61 69 | 6e 73 20 61 20 63 61 72 |p contai|ns a car|
|00001e20| 64 20 74 65 6c 6c 69 6e | 67 20 75 73 20 74 68 61 |d tellin|g us tha|
|00001e30| 74 20 44 65 76 65 6c 6f | 70 65 72 20 45 73 73 65 |t Develo|per Esse|
|00001e40| 6e 74 69 61 6c 73 20 77 | 69 6c 6c 20 62 65 20 69 |ntials w|ill be i|
|00001e50| 6e 63 6c 75 64 65 64 20 | 69 6e 20 61 20 66 6f 6c |ncluded |in a fol|
|00001e60| 64 65 72 20 6f 6e 20 6f | 75 72 20 44 65 76 65 6c |der on o|ur Devel|
|00001e70| 6f 70 65 72 20 43 44 20 | 53 65 72 69 65 73 20 64 |oper CD |Series d|
|00001e80| 69 73 63 2e 20 49 6d 61 | 67 69 6e 65 20 6d 79 20 |isc. Ima|gine my |
|00001e90| 64 69 73 61 70 70 6f 69 | 6e 74 6d 65 6e 74 20 77 |disappoi|ntment w|
|00001ea0| 68 65 6e 20 49 20 72 65 | 61 6c 69 7a 65 64 20 74 |hen I re|alized t|
|00001eb0| 68 61 74 20 74 68 65 20 | 64 69 73 63 20 41 70 70 |hat the |disc App|
|00001ec0| 6c 65 20 50 61 72 74 6e | 65 72 73 20 72 65 63 65 |le Partn|ers rece|
|00001ed0| 69 76 65 64 20 63 6f 6e | 74 61 69 6e 65 64 20 6e |ived con|tained n|
|00001ee0| 6f 20 61 75 64 69 6f 20 | 74 72 61 63 6b 2e 20 57 |o audio |track. W|
|00001ef0| 68 61 74 20 61 20 63 72 | 69 6d 65 20 74 6f 20 64 |hat a cr|ime to d|
|00001f00| 65 70 72 69 76 65 20 61 | 6c 6c 20 75 73 20 50 61 |eprive a|ll us Pa|
|00001f10| 72 74 6e 65 72 73 20 6f | 66 20 73 75 63 68 20 61 |rtners o|f such a|
|00001f20| 20 62 6f 6e 75 73 21 20 | 50 6c 65 61 73 65 20 74 | bonus! |Please t|
|00001f30| 65 6c 6c 20 79 6f 75 72 | 20 70 65 6f 70 6c 65 20 |ell your| people |
|00001f40| 74 68 61 74 20 50 61 72 | 74 6e 65 72 73 20 77 61 |that Par|tners wa|
|00001f50| 6e 74 20 74 68 65 69 72 | 20 61 75 64 69 6f 21 0d |nt their| audio!.|
|00001f60| d1 42 69 6c 6c 20 53 74 | 6f 6b 65 72 0d 54 68 65 |.Bill St|oker.The|
|00001f70| 20 44 65 76 65 6c 6f 70 | 65 72 20 43 44 20 53 65 | Develop|er CD Se|
|00001f80| 72 69 65 73 20 64 69 73 | 63 20 63 6f 6e 74 61 69 |ries dis|c contai|
|00001f90| 6e 73 20 61 20 73 75 70 | 65 72 73 65 74 20 6f 66 |ns a sup|erset of|
|00001fa0| 20 77 68 61 74 d5 73 20 | 6f 6e 20 74 68 65 20 64 | what.s |on the d|
|00001fb0| 69 73 63 20 74 68 61 74 | d5 73 20 62 6f 75 6e 64 |isc that|.s bound|
|00001fc0| 20 69 6e 74 6f 20 64 65 | 76 65 6c 6f 70 20 28 6e | into de|velop (n|
|00001fd0| 6f 77 20 63 61 6c 6c 65 | 64 20 74 68 65 20 44 65 |ow calle|d the De|
|00001fe0| 76 65 6c 6f 70 65 72 20 | 45 73 73 65 6e 74 69 61 |veloper |Essentia|
|00001ff0| 6c 73 20 64 69 73 63 29 | 2e 20 56 6f 6c 75 6d 65 |ls disc)|. Volume|
|00002000| 20 49 49 49 20 6f 66 20 | 74 68 65 20 44 65 76 65 | III of |the Deve|
|00002010| 6c 6f 70 65 72 20 43 44 | 20 53 65 72 69 65 73 20 |loper CD| Series |
|00002020| 28 d2 41 20 44 69 73 63 | 20 43 61 6c 6c 65 64 20 |(.A Disc| Called |
|00002030| 57 61 6e 64 61 d3 29 20 | 63 6f 72 72 65 73 70 6f |Wanda.) |correspo|
|00002040| 6e 64 73 20 74 6f 20 64 | 65 76 65 6c 6f 70 20 49 |nds to d|evelop I|
|00002050| 73 73 75 65 20 32 20 61 | 6e 64 20 64 6f 65 73 20 |ssue 2 a|nd does |
|00002060| 69 6e 64 65 65 64 20 63 | 6f 6e 74 61 69 6e 20 74 |indeed c|ontain t|
|00002070| 68 65 20 65 76 65 72 2d | 70 6f 70 75 6c 61 72 20 |he ever-|popular |
|00002080| 61 75 64 69 6f 20 74 72 | 61 63 6b 2c 20 61 73 20 |audio tr|ack, as |
|00002090| 70 61 72 74 20 6f 66 20 | 74 68 65 20 43 44 20 41 |part of |the CD A|
|000020a0| 75 64 69 6f 20 54 6f 6f | 6c 6b 69 74 20 64 65 6d |udio Too|lkit dem|
|000020b0| 6f 2e 20 57 65 72 65 20 | 79 6f 75 20 6c 6f 6f 6b |o. Were |you look|
|000020c0| 69 6e 67 20 66 6f 72 20 | 61 6e 20 61 75 64 69 6f |ing for |an audio|
|000020d0| 20 74 72 61 63 6b 20 6f | 6e 20 74 68 65 20 6c 61 | track o|n the la|
|000020e0| 74 65 73 74 20 44 65 76 | 65 6c 6f 70 65 72 20 43 |test Dev|eloper C|
|000020f0| 44 20 53 65 72 69 65 73 | 20 64 69 73 63 3f 20 49 |D Series| disc? I|
|00002100| 66 20 73 6f 2c 20 79 6f | 75 20 77 6f 75 6c 64 20 |f so, yo|u would |
|00002110| 69 6e 20 66 61 63 74 20 | 6e 6f 74 20 66 69 6e 64 |in fact |not find|
|00002120| 20 6f 6e 65 20 74 68 65 | 72 65 3b 20 74 68 65 72 | one the|re; ther|
|00002130| 65 20 77 61 73 6e d5 74 | 20 6f 6e 65 20 6f 6e 20 |e wasn.t| one on |
|00002140| 74 68 65 20 63 6f 72 72 | 65 73 70 6f 6e 64 69 6e |the corr|espondin|
|00002150| 67 20 44 65 76 65 6c 6f | 70 65 72 20 45 73 73 65 |g Develo|per Esse|
|00002160| 6e 74 69 61 6c 73 20 64 | 69 73 63 2c 20 65 69 74 |ntials d|isc, eit|
|00002170| 68 65 72 2e 20 52 65 73 | 74 20 61 73 73 75 72 65 |her. Res|t assure|
|00002180| 64 20 74 68 61 74 20 77 | 65 20 77 6f 6e d5 74 20 |d that w|e won.t |
|00002190| 64 65 70 72 69 76 65 20 | 41 70 70 6c 65 20 50 61 |deprive |Apple Pa|
|000021a0| 72 74 6e 65 72 73 20 6f | 66 20 61 6e 79 20 6f 66 |rtners o|f any of|
|000021b0| 20 74 68 65 20 67 6f 6f | 64 69 65 73 20 77 65 20 | the goo|dies we |
|000021c0| 70 72 6f 76 69 64 65 20 | 6f 6e 20 74 68 65 20 44 |provide |on the D|
|000021d0| 65 76 65 6c 6f 70 65 72 | 20 45 73 73 65 6e 74 69 |eveloper| Essenti|
|000021e0| 61 6c 73 20 64 69 73 63 | 21 0d d1 43 61 72 6f 6c |als disc|!..Carol|
|000021f0| 69 6e 65 20 52 6f 73 65 | 0d a5 46 69 72 73 74 20 |ine Rose|..First |
|00002200| 6c 65 74 20 6d 65 20 73 | 61 79 20 74 68 61 74 20 |let me s|ay that |
|00002210| 64 65 76 65 6c 6f 70 20 | 69 73 20 67 72 65 61 74 |develop |is great|
|00002220| 21 0d 49 20 72 65 61 64 | 20 6f 6e 20 70 61 67 65 |!.I read| on page|
|00002230| 20 35 20 6f 66 20 74 68 | 65 20 6c 61 74 65 73 74 | 5 of th|e latest|
|00002240| 20 69 73 73 75 65 20 74 | 68 61 74 20 79 6f 75 72 | issue t|hat your|
|00002250| 20 67 72 6f 75 70 20 69 | 73 20 6e 6f 77 20 72 65 | group i|s now re|
|00002260| 73 70 6f 6e 73 69 62 6c | 65 20 66 6f 72 20 74 68 |sponsibl|e for th|
|00002270| 65 20 44 65 76 65 6c 6f | 70 65 72 20 43 44 20 53 |e Develo|per CD S|
|00002280| 65 72 69 65 73 2e 20 47 | 6f 72 69 6c 6c 61 73 20 |eries. G|orillas |
|00002290| 69 6e 20 74 68 65 20 44 | 69 73 63 20 69 73 20 61 |in the D|isc is a|
|000022a0| 20 62 69 74 20 6f 66 20 | 61 20 64 69 73 61 70 70 | bit of |a disapp|
|000022b0| 6f 69 6e 74 6d 65 6e 74 | 2e 20 4e 6f 74 20 61 20 |ointment|. Not a |
|000022c0| 6c 6f 74 20 6f 66 20 72 | 65 61 6c 6c 79 20 6e 65 |lot of r|eally ne|
|000022d0| 77 20 73 74 75 66 66 20 | 6f 6e 20 69 74 2e 20 54 |w stuff |on it. T|
|000022e0| 68 61 74 d5 73 20 6e 6f | 74 20 79 6f 75 72 20 66 |hat.s no|t your f|
|000022f0| 61 75 6c 74 2c 20 49 20 | 6b 6e 6f 77 2e 20 54 68 |ault, I |know. Th|
|00002300| 65 72 65 20 6d 75 73 74 | 20 62 65 20 6e 65 61 74 |ere must| be neat|
|00002310| 20 73 74 75 66 66 20 66 | 6c 6f 61 74 69 6e 67 20 | stuff f|loating |
|00002320| 61 72 6f 75 6e 64 20 69 | 6e 20 41 70 70 6c 65 20 |around i|n Apple |
|00002330| 73 6f 6d 65 77 68 65 72 | 65 21 0d 53 6f 6d 65 6f |somewher|e!.Someo|
|00002340| 6e 65 20 64 65 63 69 64 | 65 64 20 74 68 61 74 20 |ne decid|ed that |
|00002350| 74 68 65 20 51 20 26 20 | 41 20 53 74 61 63 6b 20 |the Q & |A Stack |
|00002360| 73 68 6f 75 6c 64 20 63 | 6f 6e 74 61 69 6e 20 62 |should c|ontain b|
|00002370| 6f 74 68 20 4d 61 63 69 | 6e 74 6f 73 68 20 61 6e |oth Maci|ntosh an|
|00002380| 64 20 0d 41 70 70 6c 65 | 20 49 49 67 73 20 73 74 |d .Apple| IIgs st|
|00002390| 75 66 66 2e 20 42 6f 6f | 2c 20 68 69 73 73 21 20 |uff. Boo|, hiss! |
|000023a0| 49 20 74 65 6e 64 20 74 | 6f 20 72 65 61 64 20 74 |I tend t|o read t|
|000023b0| 68 72 6f 75 67 68 20 74 | 68 61 74 20 73 74 61 63 |hrough t|hat stac|
|000023c0| 6b 20 6c 6f 6f 6b 69 6e | 67 20 66 6f 72 20 73 74 |k lookin|g for st|
|000023d0| 75 66 66 20 49 09 0d 64 | 6f 6e d5 74 20 6b 6e 6f |uff I..d|on.t kno|
|000023e0| 77 2c 20 62 65 66 6f 72 | 65 20 49 20 6b 6e 6f 77 |w, befor|e I know|
|000023f0| 20 49 20 6e 65 65 64 20 | 74 6f 20 6b 6e 6f 77 20 | I need |to know |
|00002400| 69 74 21 20 49 20 77 61 | 73 20 72 65 61 6c 6c 79 |it! I wa|s really|
|00002410| 20 63 6f 6e 66 75 73 65 | 64 20 62 79 20 74 68 69 | confuse|d by thi|
|00002420| 6e 67 73 20 74 68 61 74 | 20 49 20 68 61 64 20 6e |ngs that| I had n|
|00002430| 65 76 65 72 20 68 65 61 | 72 64 20 6f 66 20 6f 6e |ever hea|rd of on|
|00002440| 20 74 68 65 20 4d 61 63 | 69 6e 74 6f 73 68 20 62 | the Mac|intosh b|
|00002450| 65 66 6f 72 65 2c 20 6f | 6e 6c 79 20 74 6f 20 66 |efore, o|nly to f|
|00002460| 69 6e 64 20 74 68 65 79 | 20 77 65 72 65 20 6f 6e |ind they| were on|
|00002470| 20 74 68 65 20 41 70 70 | 6c 65 20 49 49 67 73 21 | the App|le IIgs!|
|00002480| 20 41 72 72 67 67 68 21 | 20 43 61 6e 20 79 6f 75 | Arrggh!| Can you|
|00002490| 20 70 6c 65 61 73 65 20 | 73 65 70 61 72 61 74 65 | please |separate|
|000024a0| 20 74 68 65 20 49 49 67 | 73 20 73 74 75 66 66 20 | the IIg|s stuff |
|000024b0| 61 6e 64 20 74 68 65 20 | 4d 61 63 69 6e 74 6f 73 |and the |Macintos|
|000024c0| 68 20 73 74 75 66 66 20 | 69 6e 74 6f 20 74 77 6f |h stuff |into two|
|000024d0| 20 73 74 61 63 6b 73 3f | 20 41 6e 64 20 63 61 6e | stacks?| And can|
|000024e0| 20 79 6f 75 20 70 6c 65 | 61 73 65 20 67 6f 20 62 | you ple|ase go b|
|000024f0| 61 63 6b 20 74 6f 20 74 | 68 65 20 66 6f 72 6d 61 |ack to t|he forma|
|00002500| 74 20 6f 66 20 70 75 74 | 74 69 6e 67 20 64 6f 74 |t of put|ting dot|
|00002510| 73 20 62 65 73 69 64 65 | 20 74 68 65 20 6e 65 77 |s beside| the new|
|00002520| 20 73 74 75 66 66 3f 0d | 54 68 65 20 58 20 52 65 | stuff?.|The X Re|
|00002530| 66 20 73 74 75 66 66 20 | 69 73 20 6b 69 6e 64 61 |f stuff |is kinda|
|00002540| 20 6e 65 61 74 2e 20 43 | 61 6e d5 74 20 77 61 69 | neat. C|an.t wai|
|00002550| 74 20 66 6f 72 20 37 2e | 30 20 61 6c 69 61 73 69 |t for 7.|0 aliasi|
|00002560| 6e 67 21 0d d1 53 63 6f | 74 74 20 41 6e 67 75 69 |ng!..Sco|tt Angui|
|00002570| 73 68 0d 54 68 61 6e 6b | 73 20 61 20 6c 6f 74 20 |sh.Thank|s a lot |
|00002580| 66 6f 72 20 79 6f 75 72 | 20 6c 65 74 74 65 72 20 |for your| letter |
|00002590| 61 6e 64 20 79 6f 75 72 | 20 77 6f 72 64 73 20 6f |and your| words o|
|000025a0| 66 20 65 6e 63 6f 75 72 | 61 67 65 6d 65 6e 74 2e |f encour|agement.|
|000025b0| 20 4d 79 20 67 72 6f 75 | 70 20 63 6f 6e 74 72 69 | My grou|p contri|
|000025c0| 62 75 74 65 73 20 74 6f | 20 74 68 65 20 44 65 76 |butes to| the Dev|
|000025d0| 65 6c 6f 70 65 72 20 43 | 44 20 53 65 72 69 65 73 |eloper C|D Series|
|000025e0| 2c 20 62 75 74 20 77 65 | d5 72 65 20 6e 6f 74 20 |, but we|.re not |
|000025f0| 61 63 74 75 61 6c 6c 79 | 20 72 65 73 70 6f 6e 73 |actually| respons|
|00002600| 69 62 6c 65 20 66 6f 72 | 20 69 74 2e 20 42 65 73 |ible for| it. Bes|
|00002610| 69 64 65 73 20 61 64 64 | 69 6e 67 20 6d 6f 72 65 |ides add|ing more|
|00002620| 20 6e 65 77 20 d2 6e 65 | 61 74 d3 20 73 74 75 66 | new .ne|at. stuf|
|00002630| 66 2c 20 69 73 20 74 68 | 65 72 65 20 61 6e 79 74 |f, is th|ere anyt|
|00002640| 68 69 6e 67 20 77 65 20 | 63 6f 75 6c 64 20 64 6f |hing we |could do|
|00002650| 20 74 6f 20 69 6d 70 72 | 6f 76 65 20 74 68 65 20 | to impr|ove the |
|00002660| 64 69 73 63 3f 20 57 65 | d5 72 65 20 61 6c 77 61 |disc? We|.re alwa|
|00002670| 79 73 20 6c 6f 6f 6b 69 | 6e 67 20 66 6f 72 20 73 |ys looki|ng for s|
|00002680| 75 67 67 65 73 74 69 6f | 6e 73 21 0d 53 6f 72 72 |uggestio|ns!.Sorr|
|00002690| 79 20 74 6f 20 68 65 61 | 72 20 74 68 61 74 20 61 |y to hea|r that a|
|000026a0| 64 64 69 6e 67 20 41 70 | 70 6c 65 20 49 49 67 73 |dding Ap|ple IIgs|
|000026b0| 20 73 74 75 66 66 20 74 | 6f 20 74 68 65 20 51 20 | stuff t|o the Q |
|000026c0| 26 20 41 20 73 74 61 63 | 6b 20 63 6f 6e 66 75 73 |& A stac|k confus|
|000026d0| 65 64 20 79 6f 75 20 73 | 6f 20 6d 75 63 68 20 28 |ed you s|o much (|
|000026e0| 62 75 74 20 49 d5 6d 20 | 61 77 66 75 6c 6c 79 20 |but I.m |awfully |
|000026f0| 67 6c 61 64 20 74 6f 20 | 68 65 61 72 20 74 68 61 |glad to |hear tha|
|00002700| 74 20 79 6f 75 d5 72 65 | 20 62 72 6f 77 73 69 6e |t you.re| browsin|
|00002710| 67 20 74 68 65 20 51 20 | 26 20 41 20 73 74 61 63 |g the Q |& A stac|
|00002720| 6b 21 29 2e 20 57 65 20 | 70 75 74 20 74 68 65 20 |k!). We |put the |
|00002730| 49 49 67 73 20 69 6e 66 | 6f 20 69 6e 20 74 68 65 |IIgs inf|o in the|
|00002740| 20 73 74 61 63 6b 20 68 | 6f 70 69 6e 67 20 74 68 | stack h|oping th|
|00002750| 61 74 20 4d 61 63 69 6e | 74 6f 73 68 20 64 65 76 |at Macin|tosh dev|
|00002760| 65 6c 6f 70 65 72 73 20 | 77 6f 75 6c 64 20 73 65 |elopers |would se|
|00002770| 65 20 68 6f 77 20 73 69 | 6d 69 6c 61 72 20 74 68 |e how si|milar th|
|00002780| 65 20 74 77 6f 20 74 6f | 6f 6c 62 6f 78 65 73 20 |e two to|olboxes |
|00002790| 61 72 65 20 61 6e 64 20 | 70 65 72 68 61 70 73 20 |are and |perhaps |
|000027a0| 67 65 74 20 73 6f 6d 65 | 20 65 78 74 72 61 20 6d |get some| extra m|
|000027b0| 69 6c 65 61 67 65 20 66 | 72 6f 6d 20 74 68 65 69 |ileage f|rom thei|
|000027c0| 72 20 77 6f 72 6b 20 62 | 79 20 70 6f 72 74 69 6e |r work b|y portin|
|000027d0| 67 20 74 68 65 69 72 20 | 4d 61 63 69 6e 74 6f 73 |g their |Macintos|
|000027e0| 68 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 74 6f |h applic|ation to|
|000027f0| 20 74 68 65 20 49 49 67 | 73 2e 20 49 74 20 73 6f | the IIg|s. It so|
|00002800| 75 6e 64 73 20 6c 69 6b | 65 20 69 74 d5 73 20 6d |unds lik|e it.s m|
|00002810| 6f 72 65 20 63 6f 6e 66 | 75 73 69 6e 67 20 74 68 |ore conf|using th|
|00002820| 61 6e 20 68 65 6c 70 66 | 75 6c 2c 20 73 6f 20 77 |an helpf|ul, so w|
|00002830| 65 d5 6c 6c 20 72 65 65 | 76 61 6c 75 61 74 65 20 |e.ll ree|valuate |
|00002840| 6f 75 72 20 64 65 63 69 | 73 69 6f 6e 2e 20 57 68 |our deci|sion. Wh|
|00002850| 61 74 20 64 6f 20 74 68 | 65 20 72 65 73 74 20 6f |at do th|e rest o|
|00002860| 66 20 79 6f 75 20 74 68 | 69 6e 6b 20 61 62 6f 75 |f you th|ink abou|
|00002870| 74 20 63 6f 6d 62 69 6e | 69 6e 67 20 49 49 67 73 |t combin|ing IIgs|
|00002880| 20 61 6e 64 20 4d 61 63 | 69 6e 74 6f 73 68 20 69 | and Mac|intosh i|
|00002890| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 69 6e 20 6f 6e |nformati|on in on|
|000028a0| 65 20 73 74 61 63 6b 3f | 0d 49 6e 20 72 65 70 6c |e stack?|.In repl|
|000028b0| 79 20 74 6f 20 79 6f 75 | 72 20 72 65 71 75 65 73 |y to you|r reques|
|000028c0| 74 20 66 6f 72 20 64 6f | 74 73 3a 20 54 68 65 20 |t for do|ts: The |
|000028d0| 6c 61 74 65 73 74 20 51 | 20 26 20 41 20 53 74 61 |latest Q| & A Sta|
|000028e0| 63 6b 20 68 61 73 20 62 | 65 65 6e 20 72 65 77 6f |ck has b|een rewo|
|000028f0| 72 6b 65 64 20 73 6f 20 | 6d 75 63 68 20 69 74 d5 |rked so |much it.|
|00002900| 73 20 70 72 61 63 74 69 | 63 61 6c 6c 79 20 61 6c |s practi|cally al|
|00002910| 6c 20 6e 65 77 2c 20 62 | 75 74 20 69 6e 20 74 68 |l new, b|ut in th|
|00002920| 65 20 66 75 74 75 72 65 | 20 79 6f 75 20 63 61 6e |e future| you can|
|00002930| 20 65 78 70 65 63 74 20 | 74 6f 20 6f 6e 63 65 20 | expect |to once |
|00002940| 61 67 61 69 6e 20 73 65 | 65 20 64 6f 74 73 20 62 |again se|e dots b|
|00002950| 65 73 69 64 65 20 6e 65 | 77 20 6d 61 74 65 72 69 |eside ne|w materi|
|00002960| 61 6c 2e 20 41 6c 73 6f | 20 6e 6f 74 65 20 74 68 |al. Also| note th|
|00002970| 61 74 2c 20 73 74 61 72 | 74 69 6e 67 20 77 69 74 |at, star|ting wit|
|00002980| 68 20 74 68 65 20 6c 61 | 74 65 73 74 20 73 74 61 |h the la|test sta|
|00002990| 63 6b 2c 20 65 61 63 68 | 20 63 61 72 64 20 77 69 |ck, each| card wi|
|000029a0| 6c 6c 20 73 68 6f 77 20 | 74 68 65 20 64 61 74 65 |ll show |the date|
|000029b0| 20 6f 66 20 74 68 65 20 | 6c 61 73 74 20 6d 6f 64 | of the |last mod|
|000029c0| 69 66 69 63 61 74 69 6f | 6e 2e 0d d1 4c 6f 75 65 |ificatio|n...Loue|
|000029d0| 6c 6c 61 20 50 69 7a 7a | 75 74 69 09 a5 4a 75 73 |lla Pizz|uti..Jus|
|000029e0| 74 20 61 20 71 75 69 63 | 6b 20 6e 6f 74 65 20 74 |t a quic|k note t|
|000029f0| 6f 20 63 6f 6e 67 72 61 | 74 75 6c 61 74 65 20 79 |o congra|tulate y|
|00002a00| 6f 75 20 61 6e 64 20 79 | 6f 75 72 20 73 74 61 66 |ou and y|our staf|
|00002a10| 66 20 6f 6e 20 61 6e 6f | 74 68 65 72 20 66 69 6e |f on ano|ther fin|
|00002a20| 65 20 69 73 73 75 65 20 | 6f 66 20 64 65 76 65 6c |e issue |of devel|
|00002a30| 6f 70 20 28 61 6e 64 20 | 69 6e 20 74 68 65 20 68 |op (and |in the h|
|00002a40| 6f 70 65 73 20 74 68 61 | 74 20 49 20 77 6f 6e d5 |opes tha|t I won.|
|00002a50| 74 20 73 65 65 20 61 20 | 73 75 72 76 65 79 29 2e |t see a |survey).|
|00002a60| 20 49 20 72 65 61 64 20 | 69 74 20 63 6f 76 65 72 | I read |it cover|
|00002a70| 20 74 6f 20 63 6f 76 65 | 72 2c 20 61 6e 64 20 74 | to cove|r, and t|
|00002a80| 68 6f 72 6f 75 67 68 6c | 79 20 65 6e 6a 6f 79 65 |horoughl|y enjoye|
|00002a90| 64 20 69 74 2c 20 65 73 | 70 65 63 69 61 6c 6c 79 |d it, es|pecially|
|00002aa0| 20 74 68 65 20 4d 61 63 | 69 6e 74 6f 73 68 20 51 | the Mac|intosh Q|
|00002ab0| 20 26 20 41 2e 20 49 20 | 6b 65 70 74 20 74 75 72 | & A. I |kept tur|
|00002ac0| 6e 69 6e 67 20 74 68 65 | 20 70 61 67 65 20 65 78 |ning the| page ex|
|00002ad0| 70 65 63 74 69 6e 67 20 | 74 6f 20 68 61 76 65 20 |pecting |to have |
|00002ae0| 73 65 65 6e 20 74 68 65 | 20 6c 61 73 74 20 71 75 |seen the| last qu|
|00002af0| 65 73 74 69 6f 6e 20 61 | 6e 73 77 65 72 65 64 2c |estion a|nswered,|
|00002b00| 20 62 75 74 20 6c 6f 20 | 61 6e 64 20 62 65 68 6f | but lo |and beho|
|00002b10| 6c 64 2c 20 74 68 65 72 | 65 20 77 65 72 65 20 6d |ld, ther|e were m|
|00002b20| 6f 72 65 20 71 75 65 73 | 74 69 6f 6e 73 2e 20 49 |ore ques|tions. I|
|00002b30| 74 20 77 61 73 20 62 65 | 74 74 65 72 20 74 68 61 |t was be|tter tha|
|00002b40| 6e 20 4a 65 6f 70 61 72 | 64 79 2e 20 59 6f 75 20 |n Jeopar|dy. You |
|00002b50| 72 65 61 6c 6c 79 20 6f | 75 74 64 69 64 20 79 6f |really o|utdid yo|
|00002b60| 75 72 73 65 6c 76 65 73 | 21 20 4b 65 65 70 20 75 |urselves|! Keep u|
|00002b70| 70 20 74 68 65 20 77 6f | 6e 64 65 72 66 75 6c 20 |p the wo|nderful |
|00002b80| 77 6f 72 6b 2c 20 61 6e | 64 20 70 6c 65 61 73 65 |work, an|d please|
|00002b90| 20 63 6f 6e 73 69 64 65 | 72 20 73 74 61 72 74 69 | conside|r starti|
|00002ba0| 6e 67 20 61 20 6e 65 77 | 20 63 6f 6c 75 6d 6e 3a |ng a new| column:|
|00002bb0| 20 61 20 73 6f 61 70 20 | 6f 70 65 72 61 20 61 62 | a soap |opera ab|
|00002bc0| 6f 75 74 20 74 68 65 20 | 64 6f 67 63 6f 77 2e 0d |out the |dogcow..|
|00002bd0| 42 79 20 74 68 65 20 77 | 61 79 2c 20 77 68 6f 73 |By the w|ay, whos|
|00002be0| 65 20 6e 6f 73 65 20 69 | 73 20 6c 69 67 68 74 69 |e nose i|s lighti|
|00002bf0| 6e 67 20 75 70 20 74 68 | 65 20 63 6f 76 65 72 3f |ng up th|e cover?|
|00002c00| 0d d1 52 6f 62 65 72 74 | 20 48 2e 20 5a 61 6b 6f |..Robert| H. Zako|
|00002c10| 6e 0d 54 68 61 6e 6b 73 | 20 66 6f 72 20 74 68 65 |n.Thanks| for the|
|00002c20| 20 6c 65 74 74 65 72 2e | 20 49 66 20 77 65 20 65 | letter.| If we e|
|00002c30| 76 65 72 20 64 6f 20 61 | 20 73 75 72 76 65 79 20 |ver do a| survey |
|00002c40| 28 61 6e 64 20 6d 79 20 | 62 6f 73 73 20 68 61 73 |(and my |boss has|
|00002c50| 20 62 65 65 6e 20 70 75 | 73 68 69 6e 67 20 6d 65 | been pu|shing me|
|00002c60| 20 74 6f 20 64 6f 20 6f | 6e 65 20 65 76 65 72 20 | to do o|ne ever |
|00002c70| 73 69 6e 63 65 20 49 73 | 73 75 65 20 32 20 63 61 |since Is|sue 2 ca|
|00002c80| 6d 65 20 6f 75 74 29 2c | 20 49 d5 6c 6c 20 6d 61 |me out),| I.ll ma|
|00002c90| 6b 65 20 73 75 72 65 20 | 74 68 61 74 20 74 68 65 |ke sure |that the|
|00002ca0| 20 73 75 72 76 65 79 6f | 72 73 20 6b 6e 6f 77 20 | surveyo|rs know |
|00002cb0| 79 6f 75 d5 72 65 20 6f | 66 66 69 63 69 61 6c 6c |you.re o|fficiall|
|00002cc0| 79 20 65 78 65 6d 70 74 | 2e 0d 54 68 65 20 6e 6f |y exempt|..The no|
|00002cd0| 73 65 20 6f 6e 20 74 68 | 65 20 63 6f 76 65 72 20 |se on th|e cover |
|00002ce0| 62 65 6c 6f 6e 67 73 20 | 74 6f 20 43 6c 65 6f 20 |belongs |to Cleo |
|00002cf0| 48 75 67 67 69 6e 73 2c | 20 77 68 6f 20 68 61 73 |Huggins,| who has|
|00002d00| 20 64 6f 6e 65 20 61 6c | 6c 20 6f 75 72 20 63 6f | done al|l our co|
|00002d10| 76 65 72 73 20 61 6e 64 | 20 6e 6f 73 65 20 77 68 |vers and| nose wh|
|00002d20| 61 74 20 73 68 65 d5 73 | 20 64 6f 69 6e 67 2e 0d |at she.s| doing..|
|00002d30| d1 4c 6f 75 65 6c 6c 61 | 20 50 69 7a 7a 75 74 69 |.Louella| Pizzuti|
|00002d40| 0d 09 0d 0d 54 48 52 45 | 41 44 53 20 4f 4e 20 54 |....THRE|ADS ON T|
|00002d50| 48 45 20 4d 41 43 49 4e | 54 4f 53 48 0d 4d 49 43 |HE MACIN|TOSH.MIC|
|00002d60| 48 41 45 4c 20 47 4f 55 | 47 48 0d 54 68 72 65 61 |HAEL GOU|GH.Threa|
|00002d70| 64 73 20 61 72 65 20 61 | 20 67 72 65 61 74 20 77 |ds are a| great w|
|00002d80| 61 79 20 74 6f 20 69 6d | 70 72 6f 76 65 20 74 68 |ay to im|prove th|
|00002d90| 65 20 70 65 72 66 6f 72 | 6d 61 6e 63 65 20 61 6e |e perfor|mance an|
|00002da0| 64 20 73 69 6d 70 6c 69 | 66 79 20 74 68 65 20 64 |d simpli|fy the d|
|00002db0| 65 73 69 67 6e 20 6f 66 | 20 70 72 6f 67 72 61 6d |esign of| program|
|00002dc0| 73 2e 20 41 70 70 6c 65 | d5 73 20 41 64 76 61 6e |s. Apple|.s Advan|
|00002dd0| 63 65 64 20 54 65 63 68 | 6e 6f 6c 6f 67 79 20 47 |ced Tech|nology G|
|00002de0| 72 6f 75 70 20 64 65 76 | 65 6c 6f 70 65 64 20 61 |roup dev|eloped a|
|00002df0| 20 54 68 72 65 61 64 73 | 20 50 61 63 6b 61 67 65 | Threads| Package|
|00002e00| 20 74 6f 20 69 6d 70 6c | 65 6d 65 6e 74 20 74 68 | to impl|ement th|
|00002e10| 69 73 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 20 74 |is progr|amming t|
|00002e20| 65 63 68 6e 69 71 75 65 | 20 6f 6e 20 74 68 65 20 |echnique| on the |
|00002e30| 4d 61 63 69 6e 74 6f 73 | 68 2e 20 54 68 69 73 20 |Macintos|h. This |
|00002e40| 61 72 74 69 63 6c 65 20 | 65 78 70 6c 61 69 6e 73 |article |explains|
|00002e50| 20 68 6f 77 20 79 6f 75 | 20 63 61 6e 20 75 73 65 | how you| can use|
|00002e60| 20 74 68 69 73 20 70 61 | 63 6b 61 67 65 20 74 6f | this pa|ckage to|
|00002e70| 20 69 6e 63 6f 72 70 6f | 72 61 74 65 20 74 68 72 | incorpo|rate thr|
|00002e80| 65 61 64 73 20 69 6e 20 | 79 6f 75 72 20 6f 77 6e |eads in |your own|
|00002e90| 20 63 6f 64 65 2e 20 0d | 54 68 65 20 69 64 65 61 | code. .|The idea|
|00002ea0| 20 66 6f 72 20 74 68 65 | 20 54 68 72 65 61 64 73 | for the| Threads|
|00002eb0| 20 50 61 63 6b 61 67 65 | 20 61 72 6f 73 65 20 64 | Package| arose d|
|00002ec0| 75 72 69 6e 67 20 74 68 | 65 20 64 65 73 69 67 6e |uring th|e design|
|00002ed0| 20 70 68 61 73 65 20 6f | 66 20 73 6f 6d 65 20 73 | phase o|f some s|
|00002ee0| 63 69 65 6e 74 69 66 69 | 63 20 76 69 73 75 61 6c |cientifi|c visual|
|00002ef0| 69 7a 61 74 69 6f 6e 20 | 73 6f 66 74 77 61 72 65 |ization |software|
|00002f00| 2c 20 77 68 65 6e 20 77 | 65 20 64 69 73 63 6f 76 |, when w|e discov|
|00002f10| 65 72 65 64 20 74 68 61 | 74 20 73 6f 6d 65 20 6f |ered tha|t some o|
|00002f20| 66 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |f the ap|plicatio|
|00002f30| 6e 73 20 77 65 20 77 65 | 72 65 20 77 6f 72 6b 69 |ns we we|re worki|
|00002f40| 6e 67 20 6f 6e 20 6e 65 | 65 64 65 64 20 61 20 77 |ng on ne|eded a w|
|00002f50| 61 79 20 74 6f 20 6a 75 | 67 67 6c 65 20 73 65 76 |ay to ju|ggle sev|
|00002f60| 65 72 61 6c 20 73 69 6d | 75 6c 74 61 6e 65 6f 75 |eral sim|ultaneou|
|00002f70| 73 20 61 63 74 69 76 69 | 74 69 65 73 2e 20 49 74 |s activi|ties. It|
|00002f80| 20 71 75 69 63 6b 6c 79 | 20 62 65 63 61 6d 65 20 | quickly| became |
|00002f90| 63 6c 65 61 72 20 74 68 | 61 74 20 74 68 65 20 4d |clear th|at the M|
|00002fa0| 61 63 69 6e 74 6f 73 68 | 20 72 75 6e 2d 74 69 6d |acintosh| run-tim|
|00002fb0| 65 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 70 6f |e enviro|nment po|
|00002fc0| 73 65 64 20 73 6f 6d 65 | 20 73 65 72 69 6f 75 73 |sed some| serious|
|00002fd0| 20 6f 62 73 74 61 63 6c | 65 73 20 74 6f 20 61 6e | obstacl|es to an|
|00002fe0| 79 6f 6e 65 20 77 61 6e | 74 69 6e 67 20 74 6f 20 |yone wan|ting to |
|00002ff0| 69 6d 70 6c 65 6d 65 6e | 74 20 74 68 72 65 61 64 |implemen|t thread|
|00003000| 73 20 6f 6e 20 74 68 65 | 20 4d 61 63 69 6e 74 6f |s on the| Macinto|
|00003010| 73 68 2e 20 57 69 74 68 | 20 73 6f 6d 65 20 65 66 |sh. With| some ef|
|00003020| 66 6f 72 74 2c 20 77 65 | 20 77 65 72 65 20 61 62 |fort, we| were ab|
|00003030| 6c 65 20 74 6f 20 63 6f | 6d 65 20 75 70 20 77 69 |le to co|me up wi|
|00003040| 74 68 20 77 6f 72 6b 61 | 72 6f 75 6e 64 73 20 74 |th worka|rounds t|
|00003050| 68 61 74 20 6d 61 64 65 | 20 74 68 65 20 75 73 65 |hat made| the use|
|00003060| 20 6f 66 20 74 68 72 65 | 61 64 73 20 77 69 74 68 | of thre|ads with|
|00003070| 20 74 68 65 20 4d 61 63 | 69 6e 74 6f 73 68 20 4f | the Mac|intosh O|
|00003080| 53 20 72 65 6c 61 74 69 | 76 65 6c 79 20 70 61 69 |S relati|vely pai|
|00003090| 6e 6c 65 73 73 2e 20 20 | 0d 54 68 65 73 65 20 77 |nless. |.These w|
|000030a0| 6f 72 6b 61 72 6f 75 6e | 64 73 20 61 72 65 20 74 |orkaroun|ds are t|
|000030b0| 68 65 20 6d 61 69 6e 20 | 73 75 62 6a 65 63 74 20 |he main |subject |
|000030c0| 6f 66 20 74 68 69 73 20 | 61 72 74 69 63 6c 65 2e |of this |article.|
|000030d0| 20 41 66 74 65 72 20 62 | 72 69 65 66 6c 79 20 69 | After b|riefly i|
|000030e0| 6e 74 72 6f 64 75 63 69 | 6e 67 20 74 68 65 20 70 |ntroduci|ng the p|
|000030f0| 75 72 70 6f 73 65 20 61 | 6e 64 20 6d 65 63 68 61 |urpose a|nd mecha|
|00003100| 6e 69 63 73 20 6f 66 20 | 74 68 72 65 61 64 73 20 |nics of |threads |
|00003110| 69 6e 20 67 65 6e 65 72 | 61 6c 2c 20 74 68 65 20 |in gener|al, the |
|00003120| 61 72 74 69 63 6c 65 20 | 70 72 65 73 65 6e 74 73 |article |presents|
|00003130| 20 73 6f 6d 65 20 73 70 | 65 63 69 66 69 63 20 64 | some sp|ecific d|
|00003140| 65 74 61 69 6c 73 20 6f | 66 20 74 68 65 20 4d 61 |etails o|f the Ma|
|00003150| 63 69 6e 74 6f 73 68 20 | 74 68 72 65 61 64 73 20 |cintosh |threads |
|00003160| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 61 |implemen|tation a|
|00003170| 73 20 69 74 20 63 75 72 | 72 65 6e 74 6c 79 20 73 |s it cur|rently s|
|00003180| 74 61 6e 64 73 2e 20 41 | 20 73 75 6d 6d 61 72 79 |tands. A| summary|
|00003190| 20 6f 66 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e | of the |function|
|000031a0| 73 20 69 6e 20 74 68 65 | 20 54 68 72 65 61 64 73 |s in the| Threads|
|000031b0| 20 50 61 63 6b 61 67 65 | 20 61 70 70 65 61 72 73 | Package| appears|
|000031c0| 20 61 74 20 74 68 65 20 | 65 6e 64 20 6f 66 20 74 | at the |end of t|
|000031d0| 68 65 20 61 72 74 69 63 | 6c 65 2e 20 54 68 65 20 |he artic|le. The |
|000031e0| 54 68 72 65 61 64 73 20 | 50 61 63 6b 61 67 65 20 |Threads |Package |
|000031f0| 69 74 73 65 6c 66 20 61 | 6e 64 20 73 65 76 65 72 |itself a|nd sever|
|00003200| 61 6c 20 73 69 6d 70 6c | 65 20 65 78 61 6d 70 6c |al simpl|e exampl|
|00003210| 65 20 70 72 6f 67 72 61 | 6d 73 20 63 61 6e 20 62 |e progra|ms can b|
|00003220| 65 20 66 6f 75 6e 64 20 | 6f 6e 20 74 68 65 20 44 |e found |on the D|
|00003230| 65 76 65 6c 6f 70 65 72 | 20 45 73 73 65 6e 74 69 |eveloper| Essenti|
|00003240| 61 6c 73 20 64 69 73 63 | 20 66 6f 72 20 74 68 69 |als disc| for thi|
|00003250| 73 20 69 73 73 75 65 2e | 20 0d 54 68 65 20 54 68 |s issue.| .The Th|
|00003260| 72 65 61 64 73 20 50 61 | 63 6b 61 67 65 20 77 61 |reads Pa|ckage wa|
|00003270| 73 20 64 65 76 65 6c 6f | 70 65 64 20 61 73 20 61 |s develo|ped as a|
|00003280| 20 6d 65 61 6e 73 20 74 | 6f 20 61 6e 20 65 6e 64 | means t|o an end|
|00003290| 2c 20 61 6e 64 20 69 74 | d5 73 20 62 79 20 6e 6f |, and it|.s by no|
|000032a0| 20 6d 65 61 6e 73 20 74 | 68 65 20 6c 61 73 74 20 | means t|he last |
|000032b0| 77 6f 72 64 20 6f 6e 20 | 74 68 72 65 61 64 73 20 |word on |threads |
|000032c0| 66 6f 72 20 74 68 65 20 | 4d 61 63 69 6e 74 6f 73 |for the |Macintos|
|000032d0| 68 2e 20 57 65 20 77 65 | 6c 63 6f 6d 65 20 61 6e |h. We we|lcome an|
|000032e0| 79 20 73 75 67 67 65 73 | 74 69 6f 6e 73 20 79 6f |y sugges|tions yo|
|000032f0| 75 20 6d 61 79 20 68 61 | 76 65 20 66 6f 72 20 69 |u may ha|ve for i|
|00003300| 6d 70 72 6f 76 65 6d 65 | 6e 74 73 2e 20 0d 57 48 |mproveme|nts. .WH|
|00003310| 41 54 20 54 48 52 45 41 | 44 53 20 44 4f 0d 53 75 |AT THREA|DS DO.Su|
|00003320| 70 70 6f 73 65 20 79 6f | 75 20 77 61 6e 74 20 74 |ppose yo|u want t|
|00003330| 6f 20 77 72 69 74 65 20 | 61 6e 20 41 70 70 6c 65 |o write |an Apple|
|00003340| 4c 69 6e 6b a8 2d 6c 69 | 6b 65 20 63 6f 6d 6d 75 |Link.-li|ke commu|
|00003350| 6e 69 63 61 74 69 6f 6e | 73 20 70 72 6f 67 72 61 |nication|s progra|
|00003360| 6d 2e 20 59 6f 75 d5 64 | 20 6c 69 6b 65 20 74 6f |m. You.d| like to|
|00003370| 20 77 72 69 74 65 20 74 | 68 65 20 70 72 6f 67 72 | write t|he progr|
|00003380| 61 6d 20 73 6f 20 74 68 | 61 74 20 77 68 69 6c 65 |am so th|at while|
|00003390| 20 69 74 d5 73 20 64 6f | 77 6e 6c 6f 61 64 69 6e | it.s do|wnloadin|
|000033a0| 67 20 61 20 66 69 6c 65 | 2c 20 69 74 20 63 61 6e |g a file|, it can|
|000033b0| 20 61 6c 73 6f 20 70 72 | 69 6e 74 20 61 6e 20 65 | also pr|int an e|
|000033c0| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 61 6e 64 |xisting |file and|
|000033d0| 20 61 6c 6c 6f 77 20 74 | 68 65 20 75 73 65 72 20 | allow t|he user |
|000033e0| 74 6f 20 77 72 69 74 65 | 20 61 20 6e 65 77 20 6d |to write| a new m|
|000033f0| 65 73 73 61 67 65 2e 20 | 41 20 74 79 70 69 63 61 |essage. |A typica|
|00003400| 6c 20 70 72 6f 67 72 61 | 6d 20 63 61 6e 20 70 65 |l progra|m can pe|
|00003410| 72 66 6f 72 6d 20 6f 6e | 6c 79 20 6f 6e 65 20 6f |rform on|ly one o|
|00003420| 66 20 74 68 65 73 65 20 | 66 75 6e 63 74 69 6f 6e |f these |function|
|00003430| 73 20 61 74 20 61 20 74 | 69 6d 65 2c 20 64 69 73 |s at a t|ime, dis|
|00003440| 70 6c 61 79 69 6e 67 20 | 74 68 65 20 77 61 74 63 |playing |the watc|
|00003450| 68 20 63 75 72 73 6f 72 | 20 75 6e 74 69 6c 20 74 |h cursor| until t|
|00003460| 68 65 20 74 61 73 6b 20 | 69 73 20 63 6f 6d 70 6c |he task |is compl|
|00003470| 65 74 65 64 2e 20 57 68 | 61 74 d5 73 20 6e 65 65 |eted. Wh|at.s nee|
|00003480| 64 65 64 20 69 73 20 73 | 6f 6d 65 20 74 65 63 68 |ded is s|ome tech|
|00003490| 6e 69 71 75 65 20 66 6f | 72 20 61 6c 6c 6f 77 69 |nique fo|r allowi|
|000034a0| 6e 67 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 74 |ng the p|rogram t|
|000034b0| 6f 20 70 65 72 66 6f 72 | 6d 20 74 68 65 73 65 20 |o perfor|m these |
|000034c0| 74 61 73 6b 73 20 63 6f | 6e 63 75 72 72 65 6e 74 |tasks co|ncurrent|
|000034d0| 6c 79 2e 20 20 0d 0d 0d | 57 48 59 20 54 48 52 45 |ly. ...|WHY THRE|
|000034e0| 41 44 53 20 41 52 45 20 | 49 4d 50 4f 52 54 41 4e |ADS ARE |IMPORTAN|
|000034f0| 54 20 49 4e 20 54 48 45 | 20 53 59 53 54 45 4d 20 |T IN THE| SYSTEM |
|00003500| 37 2e 30 20 45 52 41 09 | 0d 49 6e 74 65 72 70 72 |7.0 ERA.|.Interpr|
|00003510| 6f 63 65 73 73 20 63 6f | 6d 6d 75 6e 69 63 61 74 |ocess co|mmunicat|
|00003520| 69 6f 6e 20 28 49 50 43 | 29 20 69 73 20 6f 6e 65 |ion (IPC|) is one|
|00003530| 20 6f 66 20 74 68 65 20 | 6d 6f 73 74 20 63 6f 6d | of the |most com|
|00003540| 70 65 6c 6c 69 6e 67 20 | 72 65 61 73 6f 6e 73 20 |pelling |reasons |
|00003550| 77 68 79 20 74 68 72 65 | 61 64 73 20 61 72 65 20 |why thre|ads are |
|00003560| 67 6f 69 6e 67 20 74 6f | 20 62 65 63 6f 6d 65 20 |going to| become |
|00003570| 69 6e 63 72 65 61 73 69 | 6e 67 6c 79 20 69 6d 70 |increasi|ngly imp|
|00003580| 6f 72 74 61 6e 74 20 69 | 6e 20 74 68 65 20 66 75 |ortant i|n the fu|
|00003590| 74 75 72 65 2e 20 54 68 | 69 73 20 62 65 63 61 6d |ture. Th|is becam|
|000035a0| 65 20 63 6c 65 61 72 20 | 74 6f 20 61 20 67 72 6f |e clear |to a gro|
|000035b0| 75 70 20 6f 66 20 75 73 | 20 77 6f 72 6b 69 6e 67 |up of us| working|
|000035c0| 20 69 6e 20 41 70 70 6c | 65 d5 73 20 41 64 76 61 | in Appl|e.s Adva|
|000035d0| 6e 63 65 64 20 54 65 63 | 68 6e 6f 6c 6f 67 79 20 |nced Tec|hnology |
|000035e0| 47 72 6f 75 70 20 77 68 | 65 6e 20 77 65 20 6f 62 |Group wh|en we ob|
|000035f0| 73 65 72 76 65 64 20 74 | 68 61 74 20 61 20 63 6c |served t|hat a cl|
|00003600| 69 65 6e 74 20 61 6e 64 | 20 61 20 73 65 72 76 65 |ient and| a serve|
|00003610| 72 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 63 6f |r applic|ation co|
|00003620| 6d 6d 75 6e 69 63 61 74 | 69 6e 67 20 76 69 61 20 |mmunicat|ing via |
|00003630| 49 50 43 20 63 6f 75 6c | 64 20 65 61 73 69 6c 79 |IPC coul|d easily|
|00003640| 20 67 65 74 20 69 6e 74 | 6f 20 61 20 64 65 61 64 | get int|o a dead|
|00003650| 6c 79 20 65 6d 62 72 61 | 63 65 2e 20 41 20 63 6c |ly embra|ce. A cl|
|00003660| 69 65 6e 74 20 77 6f 75 | 6c 64 20 61 73 6b 20 74 |ient wou|ld ask t|
|00003670| 68 65 20 73 65 72 76 65 | 72 20 61 70 70 6c 69 63 |he serve|r applic|
|00003680| 61 74 69 6f 6e 20 61 20 | 71 75 65 73 74 69 6f 6e |ation a |question|
|00003690| 20 61 6e 64 20 77 6f 75 | 6c 64 20 77 61 69 74 20 | and wou|ld wait |
|000036a0| 66 6f 72 20 61 6e 20 61 | 6e 73 77 65 72 20 62 65 |for an a|nswer be|
|000036b0| 66 6f 72 65 20 63 6f 6e | 74 69 6e 75 69 6e 67 2e |fore con|tinuing.|
|000036c0| 20 55 6e 66 6f 72 74 75 | 6e 61 74 65 6c 79 2c 20 | Unfortu|nately, |
|000036d0| 73 6f 6d 65 74 69 6d 65 | 73 20 74 68 65 20 63 6c |sometime|s the cl|
|000036e0| 69 65 6e 74 20 77 6f 75 | 6c 64 20 77 61 69 74 20 |ient wou|ld wait |
|000036f0| 66 6f 72 65 76 65 72 20 | 66 6f 72 20 74 68 65 20 |forever |for the |
|00003700| 61 6e 73 77 65 72 2e 20 | 57 68 61 74 20 68 61 70 |answer. |What hap|
|00003710| 70 65 6e 65 64 20 77 61 | 73 20 74 68 61 74 20 74 |pened wa|s that t|
|00003720| 68 65 20 73 65 72 76 65 | 72 20 6e 65 65 64 65 64 |he serve|r needed|
|00003730| 20 74 6f 20 61 73 6b 20 | 69 74 73 20 6f 77 6e 20 | to ask |its own |
|00003740| 71 75 65 73 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |question| of the |
|00003750| 63 6c 69 65 6e 74 20 62 | 65 66 6f 72 65 20 61 6e |client b|efore an|
|00003760| 73 77 65 72 69 6e 67 20 | 74 68 65 20 63 6c 69 65 |swering |the clie|
|00003770| 6e 74 2e 20 48 6f 77 65 | 76 65 72 2c 20 74 68 65 |nt. Howe|ver, the|
|00003780| 20 63 6c 69 65 6e 74 20 | 77 61 73 20 6d 6f 6e 69 | client |was moni|
|00003790| 74 6f 72 69 6e 67 20 65 | 78 63 6c 75 73 69 76 65 |toring e|xclusive|
|000037a0| 6c 79 20 66 6f 72 20 61 | 20 72 65 73 70 6f 6e 73 |ly for a| respons|
|000037b0| 65 20 74 6f 20 69 74 73 | 20 71 75 65 73 74 69 6f |e to its| questio|
|000037c0| 6e 20 61 6e 64 20 77 6f | 75 6c 64 20 69 67 6e 6f |n and wo|uld igno|
|000037d0| 72 65 20 74 68 65 20 73 | 65 72 76 65 72 d5 73 20 |re the s|erver.s |
|000037e0| 71 75 65 73 74 69 6f 6e | 2e 20 54 68 65 20 63 6c |question|. The cl|
|000037f0| 69 65 6e 74 20 6e 65 65 | 64 65 64 20 74 6f 20 61 |ient nee|ded to a|
|00003800| 6e 73 77 65 72 20 74 68 | 65 20 73 65 72 76 65 72 |nswer th|e server|
|00003810| d5 73 20 69 6e 63 6f 6d | 69 6e 67 20 71 75 65 73 |.s incom|ing ques|
|00003820| 74 69 6f 6e 20 62 65 66 | 6f 72 65 20 69 74 20 63 |tion bef|ore it c|
|00003830| 6f 75 6c 64 20 67 65 74 | 20 61 6e 20 61 6e 73 77 |ould get| an answ|
|00003840| 65 72 20 74 6f 20 69 74 | 73 20 6f 77 6e 20 71 75 |er to it|s own qu|
|00003850| 65 73 74 69 6f 6e 2e 20 | 42 6f 74 68 20 63 6c 69 |estion. |Both cli|
|00003860| 65 6e 74 20 61 6e 64 20 | 73 65 72 76 65 72 20 77 |ent and |server w|
|00003870| 6f 75 6c 64 20 62 65 20 | 73 74 6f 70 70 65 64 20 |ould be |stopped |
|00003880| 64 65 61 64 20 77 61 69 | 74 69 6e 67 20 66 6f 72 |dead wai|ting for|
|00003890| 20 74 68 65 20 6f 74 68 | 65 72 20 74 6f 20 72 65 | the oth|er to re|
|000038a0| 73 70 6f 6e 64 2e 0d 09 | 49 6e 20 61 20 73 65 6e |spond...|In a sen|
|000038b0| 73 65 2c 20 74 68 65 20 | 54 68 72 65 61 64 73 20 |se, the |Threads |
|000038c0| 50 61 63 6b 61 67 65 20 | 65 78 69 73 74 73 20 62 |Package |exists b|
|000038d0| 65 63 61 75 73 65 20 74 | 68 65 20 70 72 6f 62 6c |ecause t|he probl|
|000038e0| 65 6d 20 64 65 73 63 72 | 69 62 65 64 20 68 65 72 |em descr|ibed her|
|000038f0| 65 20 77 61 73 20 69 6e | 74 72 61 63 74 61 62 6c |e was in|tractabl|
|00003900| 65 20 77 69 74 68 6f 75 | 74 20 74 68 72 65 61 64 |e withou|t thread|
|00003910| 73 2e 20 54 68 65 20 61 | 70 70 6c 69 63 61 74 69 |s. The a|pplicati|
|00003920| 6f 6e 20 6d 75 73 74 20 | 62 65 20 62 6f 74 68 20 |on must |be both |
|00003930| 61 20 63 6c 69 65 6e 74 | 20 61 6e 64 20 61 20 73 |a client| and a s|
|00003940| 65 72 76 65 72 2e 20 49 | 74 20 6d 75 73 74 20 62 |erver. I|t must b|
|00003950| 65 20 61 62 6c 65 20 74 | 6f 20 73 69 6d 75 6c 74 |e able t|o simult|
|00003960| 61 6e 65 6f 75 73 6c 79 | 20 68 61 6e 64 6c 65 20 |aneously| handle |
|00003970| 69 6e 63 6f 6d 69 6e 67 | 20 71 75 65 73 74 69 6f |incoming| questio|
|00003980| 6e 73 20 61 6e 64 20 77 | 61 69 74 20 66 6f 72 20 |ns and w|ait for |
|00003990| 69 6e 63 6f 6d 69 6e 67 | 20 61 6e 73 77 65 72 73 |incoming| answers|
|000039a0| 2e 20 4f 74 68 65 72 20 | 61 70 70 72 6f 61 63 68 |. Other |approach|
|000039b0| 65 73 20 74 6f 20 64 6f | 69 6e 67 20 74 68 69 73 |es to do|ing this|
|000039c0| 2c 20 73 75 63 68 20 61 | 73 20 69 64 6c 65 20 70 |, such a|s idle p|
|000039d0| 72 6f 63 73 2c 20 73 6b | 69 72 74 65 64 20 74 68 |rocs, sk|irted th|
|000039e0| 65 20 63 6f 72 65 20 6f | 66 20 74 68 65 20 70 72 |e core o|f the pr|
|000039f0| 6f 62 6c 65 6d 20 61 6e | 64 20 6c 65 64 20 74 6f |oblem an|d led to|
|00003a00| 20 63 6f 64 65 20 63 6f | 6d 70 6c 65 78 69 74 79 | code co|mplexity|
|00003a10| 20 74 68 61 74 20 77 61 | 73 20 75 6e 6d 61 6e 61 | that wa|s unmana|
|00003a20| 67 65 61 62 6c 65 2e 20 | 49 64 6c 65 20 70 72 6f |geable. |Idle pro|
|00003a30| 63 73 20 70 75 73 68 20 | 74 6f 6f 20 6d 75 63 68 |cs push |too much|
|00003a40| 20 6f 66 20 74 68 65 20 | 70 72 6f 62 6c 65 6d 20 | of the |problem |
|00003a50| 6f 6e 74 6f 20 74 68 65 | 20 61 70 70 6c 69 63 61 |onto the| applica|
|00003a60| 74 69 6f 6e 20 70 72 6f | 67 72 61 6d 6d 65 72 2c |tion pro|grammer,|
|00003a70| 20 77 68 6f 20 61 6c 72 | 65 61 64 79 20 68 61 73 | who alr|eady has|
|00003a80| 20 65 6e 6f 75 67 68 20 | 74 6f 20 77 6f 72 72 79 | enough |to worry|
|00003a90| 20 61 62 6f 75 74 2e 20 | 0d 54 68 65 20 74 68 72 | about. |.The thr|
|00003aa0| 65 61 64 73 20 73 6f 6c | 75 74 69 6f 6e 20 69 73 |eads sol|ution is|
|00003ab0| 20 65 76 65 6e 20 6d 6f | 72 65 20 69 6d 70 6f 72 | even mo|re impor|
|00003ac0| 74 61 6e 74 20 6e 6f 77 | 20 74 68 61 74 20 49 50 |tant now| that IP|
|00003ad0| 43 20 68 61 73 20 62 65 | 65 6e 20 69 6e 74 65 67 |C has be|en integ|
|00003ae0| 72 61 74 65 64 20 69 6e | 74 6f 20 74 68 65 20 4d |rated in|to the M|
|00003af0| 61 63 69 6e 74 6f 73 68 | 20 4f 53 20 69 6e 20 53 |acintosh| OS in S|
|00003b00| 79 73 74 65 6d 20 37 2e | 30 2e 20 41 73 20 6d 6f |ystem 7.|0. As mo|
|00003b10| 72 65 20 70 72 6f 67 72 | 61 6d 6d 65 72 73 20 77 |re progr|ammers w|
|00003b20| 69 6c 6c 20 68 61 76 65 | 20 61 63 63 65 73 73 20 |ill have| access |
|00003b30| 74 6f 20 49 50 43 20 62 | 65 63 61 75 73 65 20 6f |to IPC b|ecause o|
|00003b40| 66 20 53 79 73 74 65 6d | 20 37 2e 30 2c 20 74 68 |f System| 7.0, th|
|00003b50| 65 79 20 77 69 6c 6c 20 | 6e 65 65 64 20 74 68 69 |ey will |need thi|
|00003b60| 73 20 65 6c 65 67 61 6e | 74 20 6d 65 74 68 6f 64 |s elegan|t method|
|00003b70| 20 6f 66 20 61 63 68 69 | 65 76 69 6e 67 20 63 6f | of achi|eving co|
|00003b80| 6e 63 75 72 72 65 6e 63 | 79 2e 20 09 0d 0d 50 72 |ncurrenc|y. ...Pr|
|00003b90| 6f 67 72 61 6d 6d 65 72 | 73 20 68 61 76 65 20 6f |ogrammer|s have o|
|00003ba0| 66 74 65 6e 20 74 72 69 | 65 64 20 74 6f 20 61 63 |ften tri|ed to ac|
|00003bb0| 68 69 65 76 65 20 63 6f | 6e 63 75 72 72 65 6e 63 |hieve co|ncurrenc|
|00003bc0| 79 20 74 68 72 6f 75 67 | 68 20 74 68 65 20 75 73 |y throug|h the us|
|00003bd0| 65 20 6f 66 20 69 64 6c | 65 20 70 72 6f 63 73 2e |e of idl|e procs.|
|00003be0| 20 46 6f 72 20 79 6f 75 | 72 20 63 6f 6d 6d 75 6e | For you|r commun|
|00003bf0| 69 63 61 74 69 6f 6e 73 | 20 70 72 6f 67 72 61 6d |ications| program|
|00003c00| 2c 20 66 6f 72 20 69 6e | 73 74 61 6e 63 65 2c 20 |, for in|stance, |
|00003c10| 79 6f 75 20 63 6f 75 6c | 64 20 77 72 69 74 65 20 |you coul|d write |
|00003c20| 74 68 65 20 64 6f 77 6e | 6c 6f 61 64 69 6e 67 2c |the down|loading,|
|00003c30| 20 70 72 69 6e 74 69 6e | 67 2c 20 61 6e 64 20 74 | printin|g, and t|
|00003c40| 65 78 74 20 65 6e 74 72 | 79 20 74 61 73 6b 73 20 |ext entr|y tasks |
|00003c50| 61 73 20 69 64 6c 65 20 | 70 72 6f 63 73 2e 20 57 |as idle |procs. W|
|00003c60| 68 69 6c 65 20 74 68 65 | 20 64 6f 77 6e 6c 6f 61 |hile the| downloa|
|00003c70| 64 20 70 72 6f 63 65 64 | 75 72 65 20 69 73 20 65 |d proced|ure is e|
|00003c80| 78 65 63 75 74 69 6e 67 | 2c 20 69 74 20 63 6f 75 |xecuting|, it cou|
|00003c90| 6c 64 20 72 65 67 75 6c | 61 72 6c 79 20 63 61 6c |ld regul|arly cal|
|00003ca0| 6c 20 61 20 70 72 69 6e | 74 69 6e 67 20 69 64 6c |l a prin|ting idl|
|00003cb0| 65 20 70 72 6f 63 20 74 | 6f 20 73 65 6e 64 20 61 |e proc t|o send a|
|00003cc0| 20 66 65 77 20 6c 69 6e | 65 73 20 6f 66 20 61 20 | few lin|es of a |
|00003cd0| 6d 65 73 73 61 67 65 20 | 74 6f 20 74 68 65 20 70 |message |to the p|
|00003ce0| 72 69 6e 74 65 72 2e 20 | 54 68 65 20 64 6f 77 6e |rinter. |The down|
|00003cf0| 6c 6f 61 64 20 70 72 6f | 63 65 64 75 72 65 20 63 |load pro|cedure c|
|00003d00| 6f 75 6c 64 20 61 6c 73 | 6f 20 70 65 72 69 6f 64 |ould als|o period|
|00003d10| 69 63 61 6c 6c 79 20 63 | 61 6c 6c 20 61 6e 20 65 |ically c|all an e|
|00003d20| 64 69 74 69 6e 67 20 70 | 72 6f 63 65 64 75 72 65 |diting p|rocedure|
|00003d30| 20 74 6f 20 61 6c 6c 6f | 77 20 74 68 65 20 75 73 | to allo|w the us|
|00003d40| 65 72 20 74 6f 20 65 6e | 74 65 72 20 74 65 78 74 |er to en|ter text|
|00003d50| 20 66 6f 72 20 61 20 6e | 65 77 20 6d 65 73 73 61 | for a n|ew messa|
|00003d60| 67 65 20 69 6e 20 61 20 | 77 69 6e 64 6f 77 2e 20 |ge in a |window. |
|00003d70| 20 0d 42 75 74 20 74 68 | 69 6e 6b 20 6f 66 20 74 | .But th|ink of t|
|00003d80| 68 65 20 74 72 65 6d 65 | 6e 64 6f 75 73 20 65 66 |he treme|ndous ef|
|00003d90| 66 6f 72 74 20 69 6e 76 | 6f 6c 76 65 64 20 69 6e |fort inv|olved in|
|00003da0| 20 77 72 69 74 69 6e 67 | 20 74 68 65 20 70 72 6f | writing| the pro|
|00003db0| 67 72 61 6d 20 73 6f 20 | 74 68 61 74 20 69 74 20 |gram so |that it |
|00003dc0| 63 61 6e 20 73 77 69 74 | 63 68 20 61 6d 6f 6e 67 |can swit|ch among|
|00003dd0| 20 74 68 65 73 65 20 74 | 61 73 6b 73 2e 20 45 76 | these t|asks. Ev|
|00003de0| 65 72 79 20 74 61 73 6b | 20 77 6f 75 6c 64 20 68 |ery task| would h|
|00003df0| 61 76 65 20 74 6f 20 73 | 61 76 65 20 76 61 72 69 |ave to s|ave vari|
|00003e00| 61 62 6c 65 73 20 65 61 | 63 68 20 74 69 6d 65 20 |ables ea|ch time |
|00003e10| 69 74 20 72 65 74 75 72 | 6e 73 20 73 6f 20 74 68 |it retur|ns so th|
|00003e20| 61 74 20 69 74 20 63 6f | 75 6c 64 20 72 65 73 75 |at it co|uld resu|
|00003e30| 6d 65 20 77 68 65 72 65 | 20 69 74 20 6c 65 66 74 |me where| it left|
|00003e40| 20 6f 66 66 2e 20 4d 6f | 73 74 20 63 6f 6d 70 6c | off. Mo|st compl|
|00003e50| 65 78 20 66 75 6e 63 74 | 69 6f 6e 73 20 77 6f 75 |ex funct|ions wou|
|00003e60| 6c 64 20 6e 6f 74 20 62 | 65 20 61 62 6c 65 20 74 |ld not b|e able t|
|00003e70| 6f 20 63 6f 6e 74 61 69 | 6e 20 64 65 65 70 20 6c |o contai|n deep l|
|00003e80| 65 76 65 6c 73 20 6f 66 | 20 6e 65 73 74 69 6e 67 |evels of| nesting|
|00003e90| 20 62 65 63 61 75 73 65 | 20 74 68 61 74 20 77 6f | because| that wo|
|00003ea0| 75 6c 64 20 6d 61 6b 65 | 20 69 74 20 69 6d 70 6f |uld make| it impo|
|00003eb0| 73 73 69 62 6c 65 20 74 | 6f 20 66 72 65 65 6c 79 |ssible t|o freely|
|00003ec0| 20 72 65 74 75 72 6e 20 | 74 6f 20 74 68 65 20 63 | return |to the c|
|00003ed0| 61 6c 6c 65 72 20 61 74 | 20 61 6e 79 20 74 69 6d |aller at| any tim|
|00003ee0| 65 2e 20 49 6e 20 66 61 | 63 74 2c 20 79 6f 75 d5 |e. In fa|ct, you.|
|00003ef0| 64 20 68 61 76 65 20 74 | 6f 20 64 69 76 69 64 65 |d have t|o divide|
|00003f00| 20 6d 6f 73 74 20 66 75 | 6e 63 74 69 6f 6e 73 20 | most fu|nctions |
|00003f10| 69 6e 74 6f 20 69 6e 63 | 6f 6e 76 65 6e 69 65 6e |into inc|onvenien|
|00003f20| 74 6c 79 20 73 6d 61 6c | 6c 20 63 68 75 6e 6b 73 |tly smal|l chunks|
|00003f30| 20 73 6f 20 74 68 61 74 | 20 79 6f 75 20 63 6f 75 | so that| you cou|
|00003f40| 6c 64 20 6a 75 67 67 6c | 65 20 62 65 74 77 65 65 |ld juggl|e betwee|
|00003f50| 6e 20 74 68 65 6d 2e 20 | 54 68 65 20 6e 65 74 20 |n them. |The net |
|00003f60| 72 65 73 75 6c 74 20 69 | 73 20 74 68 61 74 20 74 |result i|s that t|
|00003f70| 68 65 20 6d 6f 64 75 6c | 61 72 69 74 79 20 6f 66 |he modul|arity of|
|00003f80| 20 79 6f 75 72 20 70 72 | 6f 67 72 61 6d 20 77 6f | your pr|ogram wo|
|00003f90| 75 6c 64 20 62 65 20 64 | 65 73 74 72 6f 79 65 64 |uld be d|estroyed|
|00003fa0| 2c 20 61 6e 64 20 79 6f | 75 d5 64 20 68 61 76 65 |, and yo|u.d have|
|00003fb0| 20 61 20 74 72 65 6d 65 | 6e 64 6f 75 73 20 70 72 | a treme|ndous pr|
|00003fc0| 6f 67 72 61 6d 6d 69 6e | 67 20 68 65 61 64 61 63 |ogrammin|g headac|
|00003fd0| 68 65 20 6f 6e 20 79 6f | 75 72 20 68 61 6e 64 73 |he on yo|ur hands|
|00003fe0| 2e 20 20 0d 54 68 72 65 | 61 64 73 20 61 72 65 20 |. .Thre|ads are |
|00003ff0| 61 20 6d 75 63 68 20 62 | 65 74 74 65 72 20 74 65 |a much b|etter te|
|00004000| 63 68 6e 69 71 75 65 20 | 66 6f 72 20 61 63 68 69 |chnique |for achi|
|00004010| 65 76 69 6e 67 20 63 6f | 6e 63 75 72 72 65 6e 63 |eving co|ncurrenc|
|00004020| 79 20 74 68 61 6e 20 69 | 64 6c 65 20 70 72 6f 63 |y than i|dle proc|
|00004030| 73 2e 20 57 68 65 6e 20 | 79 6f 75 72 20 70 72 6f |s. When |your pro|
|00004040| 67 72 61 6d 20 75 73 65 | 73 20 74 68 72 65 61 64 |gram use|s thread|
|00004050| 73 2c 20 69 74 d5 73 20 | 6c 69 6b 65 20 61 20 6d |s, it.s |like a m|
|00004060| 69 6e 64 20 74 68 61 74 | 20 63 61 6e 20 68 61 76 |ind that| can hav|
|00004070| 65 20 73 65 76 65 72 61 | 6c 20 74 72 61 69 6e 73 |e severa|l trains|
|00004080| 20 6f 66 20 74 68 6f 75 | 67 68 74 20 73 69 6d 75 | of thou|ght simu|
|00004090| 6c 74 61 6e 65 6f 75 73 | 6c 79 2e 20 41 20 70 72 |ltaneous|ly. A pr|
|000040a0| 6f 67 72 61 6d 20 75 73 | 69 6e 67 20 69 64 6c 65 |ogram us|ing idle|
|000040b0| 20 70 72 6f 63 73 2c 20 | 69 6e 20 63 6f 6e 74 72 | procs, |in contr|
|000040c0| 61 73 74 2c 20 69 73 20 | 6c 69 6b 65 20 61 20 6d |ast, is |like a m|
|000040d0| 69 6e 64 20 77 69 74 68 | 20 61 20 73 69 6e 67 6c |ind with| a singl|
|000040e0| 65 20 74 72 61 69 6e 20 | 6f 66 20 74 68 6f 75 67 |e train |of thoug|
|000040f0| 68 74 20 74 68 61 74 20 | 6d 75 73 74 20 63 6f 6e |ht that |must con|
|00004100| 73 74 61 6e 74 6c 79 20 | 69 6e 74 65 72 72 75 70 |stantly |interrup|
|00004110| 74 20 69 74 73 65 6c 66 | 20 74 6f 20 61 74 74 65 |t itself| to atte|
|00004120| 6e 64 20 74 6f 20 73 69 | 64 65 20 69 73 73 75 65 |nd to si|de issue|
|00004130| 73 2e 20 0d 4e 6f 74 65 | 20 74 68 61 74 20 74 68 |s. .Note| that th|
|00004140| 65 72 65 d5 73 20 61 20 | 64 69 66 66 65 72 65 6e |ere.s a |differen|
|00004150| 63 65 20 62 65 74 77 65 | 65 6e 20 6d 75 6c 74 69 |ce betwe|en multi|
|00004160| 74 68 72 65 61 64 65 64 | 20 70 72 6f 67 72 61 6d |threaded| program|
|00004170| 73 20 61 6e 64 20 6d 75 | 6c 74 69 74 61 73 6b 69 |s and mu|ltitaski|
|00004180| 6e 67 20 73 79 73 74 65 | 6d 73 2e 20 4d 75 6c 74 |ng syste|ms. Mult|
|00004190| 69 74 61 73 6b 69 6e 67 | 20 69 73 20 74 68 65 20 |itasking| is the |
|000041a0| 61 62 69 6c 69 74 79 20 | 74 6f 20 72 75 6e 20 6d |ability |to run m|
|000041b0| 6f 72 65 20 74 68 61 6e | 20 6f 6e 65 20 61 70 70 |ore than| one app|
|000041c0| 6c 69 63 61 74 69 6f 6e | 20 61 74 20 6f 6e 63 65 |lication| at once|
|000041d0| 2c 20 62 75 74 20 65 61 | 63 68 0d 61 70 70 6c 69 |, but ea|ch.appli|
|000041e0| 63 61 74 69 6f 6e 20 63 | 61 6e 20 73 74 69 6c 6c |cation c|an still|
|000041f0| 20 6f 6e 6c 79 20 64 6f | 20 6f 6e 65 20 74 68 69 | only do| one thi|
|00004200| 6e 67 20 61 74 20 61 20 | 74 69 6d 65 2e 20 49 6e |ng at a |time. In|
|00004210| 20 6f 74 68 65 72 20 77 | 6f 72 64 73 2c 20 63 6f | other w|ords, co|
|00004220| 6e 63 75 72 72 65 6e 63 | 79 20 69 73 20 68 61 70 |ncurrenc|y is hap|
|00004230| 70 65 6e 69 6e 67 20 61 | 74 20 74 68 65 20 73 79 |pening a|t the sy|
|00004240| 73 74 65 6d 20 6c 65 76 | 65 6c 2e 20 41 20 6d 75 |stem lev|el. A mu|
|00004250| 6c 74 69 74 68 72 65 61 | 64 65 64 20 61 70 70 6c |ltithrea|ded appl|
|00004260| 69 63 61 74 69 6f 6e 20 | 70 65 72 66 6f 72 6d 73 |ication |performs|
|00004270| 20 63 6f 6e 63 75 72 72 | 65 6e 74 20 74 61 73 6b | concurr|ent task|
|00004280| 73 20 77 69 74 68 69 6e | 20 74 68 65 20 73 61 6d |s within| the sam|
|00004290| 65 20 70 72 6f 67 72 61 | 6d 3b 20 63 6f 6e 63 75 |e progra|m; concu|
|000042a0| 72 72 65 6e 63 79 20 68 | 61 70 70 65 6e 73 20 61 |rrency h|appens a|
|000042b0| 74 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 6c 65 |t the pr|ogram le|
|000042c0| 76 65 6c 2e 20 4f 66 20 | 63 6f 75 72 73 65 2c 20 |vel. Of |course, |
|000042d0| 69 74 d5 73 20 70 6f 73 | 73 69 62 6c 65 20 74 6f |it.s pos|sible to|
|000042e0| 20 68 61 76 65 20 61 20 | 6d 75 6c 74 69 74 61 73 | have a |multitas|
|000042f0| 6b 69 6e 67 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |king env|ironment|
|00004300| 20 69 6e 20 77 68 69 63 | 68 20 74 68 72 65 61 64 | in whic|h thread|
|00004310| 65 64 20 70 72 6f 67 72 | 61 6d 73 20 72 75 6e 2e |ed progr|ams run.|
|00004320| 20 0d 49 44 4c 45 20 50 | 52 4f 43 53 20 56 45 52 | .IDLE P|ROCS VER|
|00004330| 53 55 53 20 54 48 52 45 | 41 44 53 09 0d 49 64 6c |SUS THRE|ADS..Idl|
|00004340| 65 20 70 72 6f 63 73 20 | 68 61 76 65 20 74 72 61 |e procs |have tra|
|00004350| 64 69 74 69 6f 6e 61 6c | 6c 79 20 62 65 65 6e 20 |ditional|ly been |
|00004360| 75 73 65 64 20 74 6f 20 | 61 70 70 72 6f 61 63 68 |used to |approach|
|00004370| 20 74 68 72 65 61 64 2d | 6c 69 6b 65 20 66 75 6e | thread-|like fun|
|00004380| 63 74 69 6f 6e 61 6c 69 | 74 79 2e 20 54 68 69 73 |ctionali|ty. This|
|00004390| 20 69 6e 76 6f 6c 76 65 | 73 20 77 72 69 74 69 6e | involve|s writin|
|000043a0| 67 20 61 20 70 69 65 63 | 65 20 6f 66 20 63 6f 64 |g a piec|e of cod|
|000043b0| 65 20 74 6f 20 68 61 6e | 64 6c 65 20 61 20 70 61 |e to han|dle a pa|
|000043c0| 72 74 69 63 75 6c 61 72 | 20 74 61 73 6b 20 61 6e |rticular| task an|
|000043d0| 64 20 69 6e 73 74 61 6c | 6c 69 6e 67 20 69 74 20 |d instal|ling it |
|000043e0| 69 6e 20 61 20 71 75 65 | 75 65 20 6f 66 20 74 68 |in a que|ue of th|
|000043f0| 69 6e 67 73 20 74 68 61 | 74 20 67 65 74 20 63 61 |ings tha|t get ca|
|00004400| 6c 6c 65 64 20 70 65 72 | 69 6f 64 69 63 61 6c 6c |lled per|iodicall|
|00004410| 79 2e 20 54 68 65 72 65 | 61 66 74 65 72 2c 20 74 |y. There|after, t|
|00004420| 68 65 20 66 6c 6f 77 20 | 6f 66 20 63 6f 6e 74 72 |he flow |of contr|
|00004430| 6f 6c 20 70 75 6c 73 65 | 73 20 74 68 72 6f 75 67 |ol pulse|s throug|
|00004440| 68 20 74 68 65 20 72 6f | 75 74 69 6e 65 2c 20 77 |h the ro|utine, w|
|00004450| 68 69 63 68 20 63 61 6e | 20 64 6f 20 73 6f 6d 65 |hich can| do some|
|00004460| 20 66 69 6e 69 74 65 20 | 61 6d 6f 75 6e 74 20 6f | finite |amount o|
|00004470| 66 20 77 6f 72 6b 20 61 | 6e 64 20 74 68 65 6e 20 |f work a|nd then |
|00004480| 72 65 74 75 72 6e 2c 20 | 73 6f 20 74 68 61 74 20 |return, |so that |
|00004490| 6f 74 68 65 72 20 69 64 | 6c 65 20 70 72 6f 63 73 |other id|le procs|
|000044a0| 20 63 61 6e 20 67 65 74 | 20 70 75 6c 73 65 64 2e | can get| pulsed.|
|000044b0| 0d 54 68 69 73 20 61 70 | 70 72 6f 61 63 68 20 72 |.This ap|proach r|
|000044c0| 65 73 75 6c 74 73 20 69 | 6e 20 73 65 76 65 72 61 |esults i|n severa|
|000044d0| 6c 20 67 6e 61 72 6c 79 | 20 63 6f 64 69 6e 67 20 |l gnarly| coding |
|000044e0| 70 72 6f 62 6c 65 6d 73 | 2e 20 54 68 65 20 6d 6f |problems|. The mo|
|000044f0| 73 74 20 73 65 72 69 6f | 75 73 20 69 73 20 74 68 |st serio|us is th|
|00004500| 61 74 20 74 68 65 20 70 | 75 6c 73 65 64 20 72 6f |at the p|ulsed ro|
|00004510| 75 74 69 6e 65 2c 20 77 | 68 69 63 68 20 69 73 20 |utine, w|hich is |
|00004520| 61 74 74 65 6d 70 74 69 | 6e 67 20 74 6f 20 65 78 |attempti|ng to ex|
|00004530| 65 63 75 74 65 20 73 6f | 6d 65 20 61 6c 67 6f 72 |ecute so|me algor|
|00004540| 69 74 68 6d 2c 20 6d 75 | 73 74 20 72 65 74 75 72 |ithm, mu|st retur|
|00004550| 6e 20 74 6f 20 69 74 73 | 20 63 61 6c 6c 65 72 20 |n to its| caller |
|00004560| 61 74 20 69 6e 6f 70 70 | 6f 72 74 75 6e 65 20 6d |at inopp|ortune m|
|00004570| 6f 6d 65 6e 74 73 2e 20 | 49 6d 61 67 69 6e 65 20 |oments. |Imagine |
|00004580| 74 68 61 74 20 79 6f 75 | d5 72 65 20 6d 61 72 63 |that you|.re marc|
|00004590| 68 69 6e 67 20 74 68 72 | 6f 75 67 68 20 61 20 64 |hing thr|ough a d|
|000045a0| 65 65 70 6c 79 20 6e 65 | 73 74 65 64 20 70 69 65 |eeply ne|sted pie|
|000045b0| 63 65 20 6f 66 20 63 6f | 64 65 20 61 6e 64 20 79 |ce of co|de and y|
|000045c0| 6f 75 20 77 61 6e 74 20 | 74 6f 20 72 65 6c 69 6e |ou want |to relin|
|000045d0| 71 75 69 73 68 20 63 6f | 6e 74 72 6f 6c 20 77 68 |quish co|ntrol wh|
|000045e0| 65 6e 20 79 6f 75 20 72 | 65 61 63 68 20 61 20 63 |en you r|each a c|
|000045f0| 65 72 74 61 69 6e 20 70 | 6f 69 6e 74 2e 20 57 69 |ertain p|oint. Wi|
|00004600| 74 68 20 74 68 65 20 70 | 75 6c 73 69 6e 67 20 61 |th the p|ulsing a|
|00004610| 70 70 72 6f 61 63 68 2c | 20 79 6f 75 20 6d 75 73 |pproach,| you mus|
|00004620| 74 20 72 65 74 75 72 6e | 20 74 6f 20 74 68 65 20 |t return| to the |
|00004630| 63 61 6c 6c 65 72 20 66 | 72 6f 6d 20 64 65 65 70 |caller f|rom deep|
|00004640| 20 77 69 74 68 69 6e 20 | 74 68 65 20 6e 65 73 74 | within |the nest|
|00004650| 65 64 20 63 6f 64 65 2e | 20 59 6f 75 20 63 6f 75 |ed code.| You cou|
|00004660| 6c 64 20 70 75 74 20 69 | 6e 20 61 20 72 65 74 75 |ld put i|n a retu|
|00004670| 72 6e 20 73 74 61 74 65 | 6d 65 6e 74 2c 20 62 75 |rn state|ment, bu|
|00004680| 74 20 74 68 65 20 70 72 | 6f 62 6c 65 6d 20 77 6f |t the pr|oblem wo|
|00004690| 75 6c 64 20 62 65 20 74 | 68 61 74 20 77 68 65 6e |uld be t|hat when|
|000046a0| 20 69 74 d5 73 20 74 69 | 6d 65 20 74 6f 20 70 69 | it.s ti|me to pi|
|000046b0| 63 6b 20 75 70 20 77 68 | 65 72 65 20 79 6f 75 20 |ck up wh|ere you |
|000046c0| 6c 65 66 74 20 6f 66 66 | 2c 20 79 6f 75 20 77 6f |left off|, you wo|
|000046d0| 75 6c 64 20 68 61 76 65 | 20 74 6f 20 0d 09 6d 61 |uld have| to ..ma|
|000046e0| 67 69 63 61 6c 6c 79 20 | 6a 75 6d 70 20 62 61 63 |gically |jump bac|
|000046f0| 6b 20 69 6e 74 6f 20 74 | 68 65 20 63 6f 64 65 20 |k into t|he code |
|00004700| 61 66 74 65 72 20 74 68 | 65 20 72 65 74 75 72 6e |after th|e return|
|00004710| 20 73 74 61 74 65 6d 65 | 6e 74 20 6f 6e 20 74 68 | stateme|nt on th|
|00004720| 65 20 6e 65 78 74 20 70 | 75 6c 73 65 2e 20 4f 62 |e next p|ulse. Ob|
|00004730| 76 69 6f 75 73 6c 79 2c | 20 74 68 69 73 20 69 73 |viously,| this is|
|00004740| 20 6e 6f 74 20 61 20 73 | 69 6d 70 6c 65 20 74 68 | not a s|imple th|
|00004750| 69 6e 67 20 74 6f 20 64 | 6f 20 77 68 65 6e 20 79 |ing to d|o when y|
|00004760| 6f 75 20 68 61 76 65 20 | 74 6f 20 62 79 70 61 73 |ou have |to bypas|
|00004770| 73 20 73 65 76 65 72 61 | 6c 20 6c 61 79 65 72 73 |s severa|l layers|
|00004780| 20 6f 66 20 63 6f 6e 64 | 69 74 69 6f 6e 61 6c 73 | of cond|itionals|
|00004790| 20 61 6e 64 20 6c 6f 6f | 70 73 2e 20 0d 54 68 65 | and loo|ps. .The|
|000047a0| 20 6d 61 67 69 63 20 6f | 66 20 74 68 65 20 54 68 | magic o|f the Th|
|000047b0| 72 65 61 64 73 20 50 61 | 63 6b 61 67 65 20 69 73 |reads Pa|ckage is|
|000047c0| 20 74 68 61 74 20 69 74 | 20 61 6c 6c 6f 77 73 20 | that it| allows |
|000047d0| 79 6f 75 20 74 6f 20 61 | 76 6f 69 64 20 74 68 65 |you to a|void the|
|000047e0| 73 65 20 70 72 6f 62 6c | 65 6d 73 3a 20 79 6f 75 |se probl|ems: you|
|000047f0| 20 63 61 6e 20 6c 65 61 | 76 65 20 61 20 63 6f 6d | can lea|ve a com|
|00004800| 70 6c 65 78 20 66 75 6e | 63 74 69 6f 6e 20 61 6e |plex fun|ction an|
|00004810| 64 20 72 65 73 75 6d 65 | 20 65 78 65 63 75 74 69 |d resume| executi|
|00004820| 6f 6e 20 6f 66 20 69 74 | 20 70 72 65 63 69 73 65 |on of it| precise|
|00004830| 6c 79 20 77 68 65 72 65 | 20 79 6f 75 20 6c 65 66 |ly where| you lef|
|00004840| 74 20 6f 66 66 2e 20 57 | 69 74 68 20 69 64 6c 65 |t off. W|ith idle|
|00004850| 20 70 72 6f 63 73 2c 20 | 6f 6e 20 74 68 65 20 6f | procs, |on the o|
|00004860| 74 68 65 72 20 68 61 6e | 64 2c 20 79 6f 75 d5 72 |ther han|d, you.r|
|00004870| 65 20 66 6f 72 63 65 64 | 20 74 6f 20 63 6f 6d 70 |e forced| to comp|
|00004880| 6c 65 74 65 6c 79 20 72 | 65 64 65 73 69 67 6e 20 |letely r|edesign |
|00004890| 74 68 65 20 61 6c 67 6f | 72 69 74 68 6d 2e 20 59 |the algo|rithm. Y|
|000048a0| 6f 75 20 6d 75 73 74 20 | 67 69 76 65 20 74 68 65 |ou must |give the|
|000048b0| 20 61 6c 67 6f 72 69 74 | 68 6d 20 61 6e 20 d2 69 | algorit|hm an .i|
|000048c0| 6e 73 69 64 65 20 6f 75 | 74 d3 20 61 70 70 65 61 |nside ou|t. appea|
|000048d0| 72 61 6e 63 65 3a 20 63 | 6f 64 65 20 74 68 61 74 |rance: c|ode that|
|000048e0| 20 77 61 73 20 69 6e 20 | 74 68 65 20 6d 6f 73 74 | was in |the most|
|000048f0| 20 64 65 65 70 6c 79 20 | 6e 65 73 74 65 64 20 70 | deeply |nested p|
|00004900| 61 72 74 20 6f 66 20 74 | 68 65 20 61 6c 67 6f 72 |art of t|he algor|
|00004910| 69 74 68 6d 20 6e 6f 77 | 20 61 70 70 65 61 72 73 |ithm now| appears|
|00004920| 20 6e 65 61 72 20 65 69 | 74 68 65 72 20 74 68 65 | near ei|ther the|
|00004930| 20 74 6f 70 20 6f 72 20 | 74 68 65 20 62 6f 74 74 | top or |the bott|
|00004940| 6f 6d 20 6f 66 20 74 68 | 65 20 72 6f 75 74 69 6e |om of th|e routin|
|00004950| 65 2e 20 59 6f 75 20 6d | 61 79 20 65 76 65 6e 20 |e. You m|ay even |
|00004960| 68 61 76 65 20 74 6f 20 | 62 72 65 61 6b 20 79 6f |have to |break yo|
|00004970| 75 72 20 72 6f 75 74 69 | 6e 65 20 69 6e 74 6f 20 |ur routi|ne into |
|00004980| 73 65 76 65 72 61 6c 20 | 73 6d 61 6c 6c 65 72 20 |several |smaller |
|00004990| 66 75 6e 63 74 69 6f 6e | 73 20 74 68 61 74 20 61 |function|s that a|
|000049a0| 72 65 20 72 75 6e 20 69 | 6e 20 73 65 71 75 65 6e |re run i|n sequen|
|000049b0| 63 65 2e 20 42 75 74 20 | 64 6f 69 6e 67 20 74 68 |ce. But |doing th|
|000049c0| 65 73 65 20 74 68 69 6e | 67 73 20 77 69 6c 6c 20 |ese thin|gs will |
|000049d0| 6e 65 67 61 74 65 20 74 | 68 65 20 6e 61 74 75 72 |negate t|he natur|
|000049e0| 61 6c 20 74 6f 70 2d 64 | 6f 77 6e 20 73 74 72 75 |al top-d|own stru|
|000049f0| 63 74 75 72 65 20 6f 66 | 20 61 20 72 6f 75 74 69 |cture of| a routi|
|00004a00| 6e 65 2e 20 49 74 d5 73 | 20 61 20 6d 65 73 73 2e |ne. It.s| a mess.|
|00004a10| 20 20 0d 09 0d 48 4f 57 | 20 54 48 52 45 41 44 53 | ...HOW| THREADS|
|00004a20| 20 57 4f 52 4b 0d 57 68 | 65 6e 20 77 72 69 74 69 | WORK.Wh|en writi|
|00004a30| 6e 67 20 6d 75 6c 74 69 | 74 68 72 65 61 64 65 64 |ng multi|threaded|
|00004a40| 20 63 6f 64 65 2c 20 79 | 6f 75 20 6d 75 73 74 20 | code, y|ou must |
|00004a50| 6c 65 74 20 67 6f 20 6f | 66 20 6f 6c 64 20 69 64 |let go o|f old id|
|00004a60| 65 61 73 20 61 62 6f 75 | 74 20 68 6f 77 20 74 68 |eas abou|t how th|
|00004a70| 65 20 6d 61 63 68 69 6e | 65 20 65 78 65 63 75 74 |e machin|e execut|
|00004a80| 65 73 20 79 6f 75 72 20 | 70 72 6f 67 72 61 6d 2e |es your |program.|
|00004a90| 20 49 6e 73 74 65 61 64 | 20 6f 66 20 61 20 73 69 | Instead| of a si|
|00004aa0| 6e 67 6c 65 20 70 72 6f | 67 72 61 6d 20 63 6f 75 |ngle pro|gram cou|
|00004ab0| 6e 74 65 72 20 6d 61 72 | 63 68 69 6e 67 20 74 68 |nter mar|ching th|
|00004ac0| 72 6f 75 67 68 20 79 6f | 75 72 20 63 6f 64 65 2c |rough yo|ur code,|
|00004ad0| 20 69 6e 20 61 20 73 65 | 6e 73 65 20 79 6f 75 20 | in a se|nse you |
|00004ae0| 6e 6f 77 20 68 61 76 65 | 20 6d 61 6e 79 2e 20 57 |now have| many. W|
|00004af0| 68 69 6c 65 20 74 68 65 | 20 69 64 65 61 20 6f 66 |hile the| idea of|
|00004b00| 20 6d 75 6c 74 69 70 6c | 65 20 70 72 6f 67 72 61 | multipl|e progra|
|00004b10| 6d 20 63 6f 75 6e 74 65 | 72 73 20 6d 61 79 20 73 |m counte|rs may s|
|00004b20| 6f 75 6e 64 20 63 6f 6d | 70 6c 65 78 2c 20 79 6f |ound com|plex, yo|
|00004b30| 75 20 64 6f 6e d5 74 20 | 68 61 76 65 20 74 6f 20 |u don.t |have to |
|00004b40| 72 65 6c 65 61 72 6e 20 | 70 72 6f 67 72 61 6d 6d |relearn |programm|
|00004b50| 69 6e 67 2e 20 59 6f 75 | 20 6a 75 73 74 20 6e 65 |ing. You| just ne|
|00004b60| 65 64 20 74 6f 20 62 65 | 20 61 77 61 72 65 20 74 |ed to be| aware t|
|00004b70| 68 61 74 20 74 68 65 20 | 6d 61 69 6e 20 74 72 61 |hat the |main tra|
|00004b80| 69 6e 20 6f 66 20 65 78 | 65 63 75 74 69 6f 6e 20 |in of ex|ecution |
|00004b90| 69 6e 20 61 20 70 72 6f | 67 72 61 6d 20 69 73 20 |in a pro|gram is |
|00004ba0| 69 74 73 65 6c 66 20 61 | 20 74 68 72 65 61 64 20 |itself a| thread |
|00004bb0| 61 6e 64 20 74 68 61 74 | 20 61 6c 6c 20 74 68 72 |and that| all thr|
|00004bc0| 65 61 64 73 20 6d 75 73 | 74 20 72 65 6c 69 6e 71 |eads mus|t relinq|
|00004bd0| 75 69 73 68 20 63 6f 6e | 74 72 6f 6c 20 74 6f 20 |uish con|trol to |
|00004be0| 65 61 63 68 20 6f 74 68 | 65 72 2e 20 59 6f 75 20 |each oth|er. You |
|00004bf0| 61 6c 73 6f 20 68 61 76 | 65 20 74 6f 20 72 65 6d |also hav|e to rem|
|00004c00| 65 6d 62 65 72 20 74 6f | 20 73 68 61 72 65 20 67 |ember to| share g|
|00004c10| 6c 6f 62 61 6c 73 20 61 | 6e 64 20 68 65 61 70 20 |lobals a|nd heap |
|00004c20| 6f 62 6a 65 63 74 73 20 | 74 68 61 74 20 79 6f 75 |objects |that you|
|00004c30| 20 75 73 65 64 20 74 6f | 20 61 63 63 65 73 73 20 | used to| access |
|00004c40| 65 78 63 6c 75 73 69 76 | 65 6c 79 2e 0d 48 65 72 |exclusiv|ely..Her|
|00004c50| 65 d5 73 20 61 20 73 61 | 6d 70 6c 65 20 70 72 6f |e.s a sa|mple pro|
|00004c60| 67 72 61 6d 20 74 68 61 | 74 20 73 68 6f 77 73 20 |gram tha|t shows |
|00004c70| 68 6f 77 20 73 69 6d 70 | 6c 65 20 69 74 20 69 73 |how simp|le it is|
|00004c80| 20 74 6f 20 75 73 65 20 | 74 68 72 65 61 64 73 2e | to use |threads.|
|00004c90| 20 54 68 65 20 70 72 6f | 67 72 61 6d 20 69 73 20 | The pro|gram is |
|00004ca0| 61 20 6d 6f 64 69 66 69 | 65 64 20 76 65 72 73 69 |a modifi|ed versi|
|00004cb0| 6f 6e 20 6f 66 20 74 68 | 65 20 65 76 65 72 2d 70 |on of th|e ever-p|
|00004cc0| 6f 70 75 6c 61 72 20 53 | 69 6c 6c 79 42 61 6c 6c |opular S|illyBall|
|00004cd0| 73 2e 20 55 6e 6d 6f 64 | 69 66 69 65 64 2c 20 74 |s. Unmod|ified, t|
|00004ce0| 68 65 20 70 72 6f 67 72 | 61 6d 20 6f 70 65 6e 73 |he progr|am opens|
|00004cf0| 20 61 20 77 69 6e 64 6f | 77 20 61 6e 64 20 64 72 | a windo|w and dr|
|00004d00| 61 77 73 20 63 6f 6c 6f | 72 65 64 20 62 61 6c 6c |aws colo|red ball|
|00004d10| 73 20 69 6e 74 6f 20 69 | 74 20 75 6e 74 69 6c 20 |s into i|t until |
|00004d20| 74 68 65 20 6d 61 69 6e | 20 65 76 65 6e 74 20 6c |the main| event l|
|00004d30| 6f 6f 70 20 64 65 74 65 | 63 74 73 20 74 68 61 74 |oop dete|cts that|
|00004d40| 20 74 68 65 20 6d 6f 75 | 73 65 20 62 75 74 74 6f | the mou|se butto|
|00004d50| 6e 20 69 73 20 64 6f 77 | 6e 2e 20 54 68 69 73 20 |n is dow|n. This |
|00004d60| 6e 65 77 20 76 65 72 73 | 69 6f 6e 20 66 6f 72 6b |new vers|ion fork|
|00004d70| 73 20 61 20 74 68 72 65 | 61 64 20 74 68 61 74 20 |s a thre|ad that |
|00004d80| 62 65 65 70 73 20 77 68 | 69 6c 65 20 74 68 65 20 |beeps wh|ile the |
|00004d90| 62 61 6c 6c 73 20 61 72 | 65 20 62 65 69 6e 67 20 |balls ar|e being |
|00004da0| 64 72 61 77 6e 2e 0d 6d | 61 69 6e 28 29 0d 7b 0d |drawn..m|ain().{.|
|00004db0| 09 20 54 68 72 65 61 64 | 48 61 6e 64 6c 65 20 62 |. Thread|Handle b|
|00004dc0| 65 65 70 54 68 72 65 61 | 64 3b 0d 09 20 49 6e 69 |eepThrea|d;.. Ini|
|00004dd0| 74 69 61 6c 69 7a 65 28 | 29 3b 0d 2f 2a 20 54 68 |tialize(|);./* Th|
|00004de0| 65 20 49 6e 69 74 54 68 | 72 65 61 64 73 20 63 61 |e InitTh|reads ca|
|00004df0| 6c 6c 20 69 6e 69 74 69 | 61 6c 69 7a 65 73 20 74 |ll initi|alizes t|
|00004e00| 68 65 20 54 68 72 65 61 | 64 73 20 50 61 63 6b 61 |he Threa|ds Packa|
|00004e10| 67 65 2c 20 63 6f 6e 76 | 65 72 74 69 6e 67 20 74 |ge, conv|erting t|
|00004e20| 68 65 20 6f 72 69 67 69 | 6e 61 6c 20 74 68 72 65 |he origi|nal thre|
|00004e30| 61 64 20 6f 66 20 65 78 | 65 63 75 74 69 6f 6e 20 |ad of ex|ecution |
|00004e40| 69 6e 74 6f 20 61 20 73 | 77 61 70 70 61 62 6c 65 |into a s|wappable|
|00004e50| 20 74 68 72 65 61 64 2e | 20 2a 2f 0d 09 20 49 6e | thread.| */.. In|
|00004e60| 69 74 54 68 72 65 61 64 | 73 28 6e 69 6c 2c 20 66 |itThread|s(nil, f|
|00004e70| 61 6c 73 65 29 3b 0d 2f | 2a 20 54 68 69 73 20 63 |alse);./|* This c|
|00004e80| 6f 64 65 20 66 6f 72 6b | 73 20 61 20 74 68 72 65 |ode fork|s a thre|
|00004e90| 61 64 20 74 68 61 74 20 | 62 65 65 70 73 20 33 30 |ad that |beeps 30|
|00004ea0| 20 74 69 6d 65 73 2c 20 | 61 6e 64 20 74 68 65 6e | times, |and then|
|00004eb0| 20 71 75 69 74 73 2e 20 | 2a 2f 0d 09 20 69 66 20 | quits. |*/.. if |
|00004ec0| 28 49 6e 4e 65 77 54 68 | 72 65 61 64 28 26 62 65 |(InNewTh|read(&be|
|00004ed0| 65 70 54 68 72 65 61 64 | 2c 20 6b 44 65 66 61 75 |epThread|, kDefau|
|00004ee0| 6c 74 53 74 61 63 6b 53 | 69 7a 65 29 29 0d 09 09 |ltStackS|ize))...|
|00004ef0| 20 7b 0d 09 09 20 6c 6f | 6e 67 20 69 3b 0d 09 09 | {... lo|ng i;...|
|00004f00| 20 66 6f 72 20 28 69 3d | 30 3b 20 69 3c 33 30 3b | for (i=|0; i<30;|
|00004f10| 20 69 2b 2b 29 0d 09 09 | 09 20 7b 0d 09 09 09 20 | i++)...|. {.... |
|00004f20| 53 79 73 42 65 65 70 28 | 31 32 30 29 3b 0d 09 09 |SysBeep(|120);...|
|00004f30| 09 20 59 69 65 6c 64 28 | 29 3b 0d 09 09 09 20 7d |. Yield(|);.... }|
|00004f40| 0d 09 09 20 45 6e 64 54 | 68 72 65 61 64 28 62 65 |... EndT|hread(be|
|00004f50| 65 70 54 68 72 65 61 64 | 29 3b 0d 09 09 20 7d 0d |epThread|);... }.|
|00004f60| 2f 2a 20 48 65 72 65 27 | 73 20 74 68 65 20 6d 61 |/* Here'|s the ma|
|00004f70| 69 6e 20 65 76 65 6e 74 | 20 6c 6f 6f 70 2e 20 54 |in event| loop. T|
|00004f80| 68 65 20 6f 6e 6c 79 20 | 63 68 61 6e 67 65 20 69 |he only |change i|
|00004f90| 73 20 74 68 65 20 6e 65 | 77 20 63 61 6c 6c 20 74 |s the ne|w call t|
|00004fa0| 6f 20 59 69 65 6c 64 2e | 20 2a 2f 0d 09 20 64 6f |o Yield.| */.. do|
|00004fb0| 20 0d 09 09 20 7b 0d 09 | 09 20 59 69 65 6c 64 28 | ... {..|. Yield(|
|00004fc0| 29 3b 0d 09 09 20 4e 65 | 77 42 61 6c 6c 28 29 3b |);... Ne|wBall();|
|00004fd0| 0d 09 09 20 7d 20 77 68 | 69 6c 65 20 28 21 42 75 |... } wh|ile (!Bu|
|00004fe0| 74 74 6f 6e 28 29 29 3b | 0d 2f 2a 20 54 68 69 73 |tton());|./* This|
|00004ff0| 20 63 61 6c 6c 20 74 6f | 20 45 78 69 74 54 68 72 | call to| ExitThr|
|00005000| 65 61 64 73 20 77 61 69 | 74 73 20 66 6f 72 20 61 |eads wai|ts for a|
|00005010| 6c 6c 20 74 68 72 65 61 | 64 73 20 74 6f 20 64 69 |ll threa|ds to di|
|00005020| 65 20 62 65 66 6f 72 65 | 20 61 6c 6c 6f 77 69 6e |e before| allowin|
|00005030| 67 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 74 6f |g the pr|ogram to|
|00005040| 20 74 65 72 6d 69 6e 61 | 74 65 2e 20 2a 2f 0d 09 | termina|te. */..|
|00005050| 20 45 78 69 74 54 68 72 | 65 61 64 73 28 29 3b 0d | ExitThr|eads();.|
|00005060| 7d 0d 54 68 65 20 49 6e | 69 74 54 68 72 65 61 64 |}.The In|itThread|
|00005070| 73 20 63 61 6c 6c 20 69 | 73 20 6d 61 64 65 20 61 |s call i|s made a|
|00005080| 74 20 74 68 65 20 62 65 | 67 69 6e 6e 69 6e 67 20 |t the be|ginning |
|00005090| 6f 66 20 74 68 65 20 70 | 72 6f 67 72 61 6d 2e 20 |of the p|rogram. |
|000050a0| 49 74 20 69 6e 69 74 69 | 61 6c 69 7a 65 73 20 74 |It initi|alizes t|
|000050b0| 68 72 65 61 64 73 20 61 | 6e 64 20 63 6f 6e 76 65 |hreads a|nd conve|
|000050c0| 72 74 73 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |rts the |original|
|000050d0| 20 74 68 72 65 61 64 20 | 69 6e 74 6f 20 73 6f 6d | thread |into som|
|000050e0| 65 74 68 69 6e 67 20 74 | 68 61 74 20 63 61 6e 20 |ething t|hat can |
|000050f0| 62 65 20 73 77 61 70 70 | 65 64 20 62 79 20 74 68 |be swapp|ed by th|
|00005100| 65 20 54 68 72 65 61 64 | 73 20 50 61 63 6b 61 67 |e Thread|s Packag|
|00005110| 65 2e 20 4f 6e 63 65 20 | 74 68 69 73 20 63 61 6c |e. Once |this cal|
|00005120| 6c 20 69 73 20 6d 61 64 | 65 2c 20 79 6f 75 20 63 |l is mad|e, you c|
|00005130| 61 6e 20 66 6f 72 6b 20 | 6f 74 68 65 72 20 74 68 |an fork |other th|
|00005140| 72 65 61 64 73 2e 0d 49 | 6e 20 74 68 69 73 20 65 |reads..I|n this e|
|00005150| 78 61 6d 70 6c 65 2c 20 | 65 78 65 63 75 74 69 6f |xample, |executio|
|00005160| 6e 20 66 72 6f 6d 20 74 | 68 65 20 6f 72 69 67 69 |n from t|he origi|
|00005170| 6e 61 6c 20 74 68 72 65 | 61 64 20 65 6e 74 65 72 |nal thre|ad enter|
|00005180| 73 20 74 68 65 20 49 6e | 4e 65 77 54 68 72 65 61 |s the In|NewThrea|
|00005190| 64 20 70 72 6f 63 65 64 | 75 72 65 2e 20 54 77 6f |d proced|ure. Two|
|000051a0| 20 74 68 72 65 61 64 73 | 20 6c 65 61 76 65 20 74 | threads| leave t|
|000051b0| 68 65 20 70 72 6f 63 65 | 64 75 72 65 2c 20 62 75 |he proce|dure, bu|
|000051c0| 74 20 61 74 20 64 69 66 | 66 65 72 65 6e 74 20 74 |t at dif|ferent t|
|000051d0| 69 6d 65 73 2e 20 54 68 | 65 20 6f 72 69 67 69 6e |imes. Th|e origin|
|000051e0| 61 6c 20 74 68 72 65 61 | 64 20 67 6f 65 73 20 69 |al threa|d goes i|
|000051f0| 6e 20 61 6e 64 20 69 73 | 20 63 6c 6f 6e 65 64 20 |n and is| cloned |
|00005200| 62 65 66 6f 72 65 20 63 | 6f 6d 69 6e 67 20 6f 75 |before c|oming ou|
|00005210| 74 2e 20 41 20 6e 65 77 | 20 74 68 72 65 61 64 20 |t. A new| thread |
|00005220| 6e 6f 77 20 65 78 69 73 | 74 73 2c 20 62 75 74 20 |now exis|ts, but |
|00005230| 69 74 20 68 61 73 6e d5 | 74 20 73 74 61 72 74 65 |it hasn.|t starte|
|00005240| 64 20 65 78 65 63 75 74 | 69 6f 6e 20 79 65 74 2e |d execut|ion yet.|
|00005250| 20 49 6e 4e 65 77 54 68 | 72 65 61 64 20 74 65 73 | InNewTh|read tes|
|00005260| 74 73 20 77 68 65 74 68 | 65 72 20 74 68 65 20 63 |ts wheth|er the c|
|00005270| 75 72 72 65 6e 74 20 74 | 68 72 65 61 64 d5 73 20 |urrent t|hread.s |
|00005280| 49 44 20 69 73 20 74 68 | 61 74 20 6f 66 20 74 68 |ID is th|at of th|
|00005290| 65 20 6e 65 77 20 74 68 | 72 65 61 64 2c 20 62 65 |e new th|read, be|
|000052a0| 65 70 54 68 72 65 61 64 | 2c 20 61 6e 64 20 72 65 |epThread|, and re|
|000052b0| 74 75 72 6e 73 20 61 20 | 42 6f 6f 6c 65 61 6e 20 |turns a |Boolean |
|000052c0| 69 6e 64 69 63 61 74 69 | 6e 67 20 74 68 65 20 72 |indicati|ng the r|
|000052d0| 65 73 75 6c 74 20 6f 66 | 20 74 68 69 73 20 74 65 |esult of| this te|
|000052e0| 73 74 2e 20 49 74 d5 73 | 20 65 73 73 65 6e 74 69 |st. It.s| essenti|
|000052f0| 61 6c 6c 79 20 73 75 70 | 70 6c 79 69 6e 67 20 61 |ally sup|plying a|
|00005300| 6e 20 61 6e 73 77 65 72 | 20 74 6f 20 74 68 65 20 |n answer| to the |
|00005310| 71 75 65 73 74 69 6f 6e | 20 d2 41 6d 20 49 20 72 |question| .Am I r|
|00005320| 75 6e 6e 69 6e 67 20 74 | 68 65 20 6e 65 77 20 74 |unning t|he new t|
|00005330| 68 72 65 61 64 3f d3 20 | 53 69 6e 63 65 20 74 68 |hread?. |Since th|
|00005340| 65 20 6f 72 69 67 69 6e | 61 6c 20 74 68 72 65 61 |e origin|al threa|
|00005350| 64 20 69 73 20 73 74 69 | 6c 6c 20 74 68 65 20 63 |d is sti|ll the c|
|00005360| 75 72 72 65 6e 74 20 74 | 68 72 65 61 64 2c 20 69 |urrent t|hread, i|
|00005370| 74 20 72 65 74 75 72 6e | 73 20 66 72 6f 6d 20 49 |t return|s from I|
|00005380| 6e 4e 65 77 54 68 72 65 | 61 64 20 77 69 74 68 20 |nNewThre|ad with |
|00005390| 61 20 76 61 6c 75 65 20 | 6f 66 20 66 61 6c 73 65 |a value |of false|
|000053a0| 2c 20 74 68 75 73 20 73 | 6b 69 70 70 69 6e 67 20 |, thus s|kipping |
|000053b0| 6f 76 65 72 20 74 68 65 | 20 63 6f 64 65 20 63 6f |over the| code co|
|000053c0| 6e 74 61 69 6e 65 64 20 | 69 6e 20 74 68 65 20 49 |ntained |in the I|
|000053d0| 46 20 62 6c 6f 63 6b 2e | 20 49 74 20 63 6f 6e 74 |F block.| It cont|
|000053e0| 69 6e 75 65 73 20 65 78 | 65 63 75 74 69 6f 6e 20 |inues ex|ecution |
|000053f0| 62 79 20 65 6e 74 65 72 | 69 6e 67 20 74 68 65 20 |by enter|ing the |
|00005400| 6d 61 69 6e 20 65 76 65 | 6e 74 20 6c 6f 6f 70 2c |main eve|nt loop,|
|00005410| 20 64 72 61 77 69 6e 67 | 20 62 61 6c 6c 73 2c 20 | drawing| balls, |
|00005420| 61 6e 64 20 63 61 6c 6c | 69 6e 67 20 74 68 65 20 |and call|ing the |
|00005430| 59 69 65 6c 64 20 66 75 | 6e 63 74 69 6f 6e 2e 20 |Yield fu|nction. |
|00005440| 45 61 63 68 20 74 69 6d | 65 20 69 74 20 63 61 6c |Each tim|e it cal|
|00005450| 6c 73 20 59 69 65 6c 64 | 2c 20 69 74 20 70 6f 6c |ls Yield|, it pol|
|00005460| 69 74 65 6c 79 20 67 69 | 76 65 73 20 63 6f 6e 74 |itely gi|ves cont|
|00005470| 72 6f 6c 20 74 6f 20 6f | 74 68 65 72 20 74 68 72 |rol to o|ther thr|
|00005480| 65 61 64 73 20 74 68 61 | 74 20 6d 61 79 20 77 61 |eads tha|t may wa|
|00005490| 6e 74 20 74 69 6d 65 20 | 74 6f 20 65 78 65 63 75 |nt time |to execu|
|000054a0| 74 65 2e 20 20 0d 4f 6e | 20 74 68 65 20 66 69 72 |te. .On| the fir|
|000054b0| 73 74 20 63 61 6c 6c 20 | 74 6f 20 59 69 65 6c 64 |st call |to Yield|
|000054c0| 2c 20 74 68 65 20 6e 65 | 77 6c 79 20 63 6c 6f 6e |, the ne|wly clon|
|000054d0| 65 64 20 74 68 72 65 61 | 64 20 72 65 74 75 72 6e |ed threa|d return|
|000054e0| 73 20 66 72 6f 6d 20 74 | 68 65 20 63 61 6c 6c 20 |s from t|he call |
|000054f0| 74 6f 20 49 6e 4e 65 77 | 54 68 72 65 61 64 20 77 |to InNew|Thread w|
|00005500| 69 74 68 20 61 20 76 61 | 6c 75 65 20 6f 66 20 74 |ith a va|lue of t|
|00005510| 72 75 65 2c 20 69 6e 64 | 69 63 61 74 69 6e 67 20 |rue, ind|icating |
|00005520| 74 68 61 74 20 74 68 69 | 73 20 69 73 20 74 68 65 |that thi|s is the|
|00005530| 20 6e 65 77 20 74 68 72 | 65 61 64 20 61 6e 64 20 | new thr|ead and |
|00005540| 6e 6f 74 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |not the |original|
|00005550| 2e 20 54 68 65 20 6e 65 | 77 20 74 68 72 65 61 64 |. The ne|w thread|
|00005560| 20 65 6e 74 65 72 73 20 | 74 68 65 20 62 6c 6f 63 | enters |the bloc|
|00005570| 6b 20 6f 66 20 63 6f 64 | 65 20 61 73 73 6f 63 69 |k of cod|e associ|
|00005580| 61 74 65 64 20 77 69 74 | 68 20 74 68 65 20 49 46 |ated wit|h the IF|
|00005590| 20 73 74 61 74 65 6d 65 | 6e 74 20 61 6e 64 20 62 | stateme|nt and b|
|000055a0| 65 67 69 6e 73 20 65 78 | 65 63 75 74 69 6e 67 20 |egins ex|ecuting |
|000055b0| 74 68 65 20 6c 6f 6f 70 | 2c 20 77 68 69 63 68 20 |the loop|, which |
|000055c0| 62 65 65 70 73 20 61 6e | 64 20 79 69 65 6c 64 73 |beeps an|d yields|
|000055d0| 20 33 30 20 74 69 6d 65 | 73 2e 20 45 61 63 68 20 | 30 time|s. Each |
|000055e0| 63 61 6c 6c 20 74 6f 20 | 59 69 65 6c 64 20 65 78 |call to |Yield ex|
|000055f0| 63 68 61 6e 67 65 73 20 | 63 6f 6e 74 72 6f 6c 20 |changes |control |
|00005600| 77 69 74 68 20 74 68 65 | 20 6d 61 69 6e 20 65 76 |with the| main ev|
|00005610| 65 6e 74 20 6c 6f 6f 70 | 2e 20 54 68 65 20 6e 65 |ent loop|. The ne|
|00005620| 77 20 74 68 72 65 61 64 | 20 6c 69 76 65 73 20 6f |w thread| lives o|
|00005630| 75 74 20 69 74 73 20 6c | 69 66 65 20 77 69 74 68 |ut its l|ife with|
|00005640| 69 6e 20 74 68 65 20 63 | 6f 6e 66 69 6e 65 73 20 |in the c|onfines |
|00005650| 6f 66 20 74 68 65 20 49 | 46 20 62 6c 6f 63 6b 2e |of the I|F block.|
|00005660| 20 41 66 74 65 72 20 63 | 6f 6d 70 6c 65 74 69 6e | After c|ompletin|
|00005670| 67 20 69 74 73 20 74 61 | 73 6b 2c 20 69 74 20 63 |g its ta|sk, it c|
|00005680| 61 6c 6c 73 20 45 6e 64 | 54 68 72 65 61 64 20 61 |alls End|Thread a|
|00005690| 6e 64 20 64 69 65 73 2e | 0d 54 68 65 20 63 6f 6e |nd dies.|.The con|
|000056a0| 64 69 74 69 6f 6e 73 20 | 66 6f 72 20 74 65 72 6d |ditions |for term|
|000056b0| 69 6e 61 74 69 6e 67 20 | 74 68 65 73 65 20 74 77 |inating |these tw|
|000056c0| 6f 20 74 68 72 65 61 64 | 73 20 61 72 65 20 64 69 |o thread|s are di|
|000056d0| 66 66 65 72 65 6e 74 3a | 20 74 68 65 20 62 65 65 |fferent:| the bee|
|000056e0| 70 69 6e 67 20 74 68 72 | 65 61 64 20 65 6e 64 73 |ping thr|ead ends|
|000056f0| 20 61 66 74 65 72 20 33 | 30 20 69 74 65 72 61 74 | after 3|0 iterat|
|00005700| 69 6f 6e 73 3b 20 74 68 | 65 20 6f 72 69 67 69 6e |ions; th|e origin|
|00005710| 61 6c 20 74 68 72 65 61 | 64 20 65 6e 64 73 20 77 |al threa|d ends w|
|00005720| 68 65 6e 20 74 68 65 20 | 75 73 65 72 20 70 72 65 |hen the |user pre|
|00005730| 73 73 65 73 20 74 68 65 | 20 6d 6f 75 73 65 20 62 |sses the| mouse b|
|00005740| 75 74 74 6f 6e 2e 20 54 | 68 65 20 63 61 6c 6c 20 |utton. T|he call |
|00005750| 74 6f 20 45 78 69 74 54 | 68 72 65 61 64 73 20 61 |to ExitT|hreads a|
|00005760| 74 20 74 68 65 20 65 6e | 64 20 6f 66 20 74 68 65 |t the en|d of the|
|00005770| 20 70 72 6f 67 72 61 6d | 20 65 6e 73 75 72 65 73 | program| ensures|
|00005780| 20 74 68 61 74 20 61 6c | 6c 20 74 68 72 65 61 64 | that al|l thread|
|00005790| 73 20 68 61 76 65 20 63 | 6f 6d 70 6c 65 74 65 64 |s have c|ompleted|
|000057a0| 20 62 65 66 6f 72 65 20 | 74 68 65 20 70 72 6f 67 | before |the prog|
|000057b0| 72 61 6d 20 74 65 72 6d | 69 6e 61 74 65 73 2e 0d |ram term|inates..|
|000057c0| 53 45 4d 41 50 48 4f 52 | 45 53 0d 57 69 74 68 20 |SEMAPHOR|ES.With |
|000057d0| 6d 75 6c 74 69 70 6c 65 | 20 74 68 72 65 61 64 73 |multiple| threads|
|000057e0| 20 72 75 6e 6e 69 6e 67 | 20 61 72 6f 75 6e 64 20 | running| around |
|000057f0| 69 6e 20 79 6f 75 72 20 | 70 72 6f 67 72 61 6d 2c |in your |program,|
|00005800| 20 69 74 d5 73 20 70 6f | 73 73 69 62 6c 65 20 66 | it.s po|ssible f|
|00005810| 6f 72 20 74 68 65 6d 20 | 74 6f 20 67 65 74 20 69 |or them |to get i|
|00005820| 6e 20 65 61 63 68 20 6f | 74 68 65 72 d5 73 20 77 |n each o|ther.s w|
|00005830| 61 79 2e 20 54 68 65 20 | 54 68 72 65 61 64 73 20 |ay. The |Threads |
|00005840| 50 61 63 6b 61 67 65 20 | 70 72 6f 76 69 64 65 73 |Package |provides|
|00005850| 20 61 20 73 65 6d 61 70 | 68 6f 72 65 20 6d 65 63 | a semap|hore mec|
|00005860| 68 61 6e 69 73 6d 20 74 | 6f 20 68 65 6c 70 20 79 |hanism t|o help y|
|00005870| 6f 75 20 6d 61 6e 61 67 | 65 20 74 68 69 73 20 70 |ou manag|e this p|
|00005880| 72 6f 62 6c 65 6d 2e 20 | 54 68 65 20 70 72 6f 62 |roblem. |The prob|
|00005890| 6c 65 6d 20 6f 63 63 75 | 72 73 20 77 68 65 6e 20 |lem occu|rs when |
|000058a0| 74 77 6f 20 74 68 72 65 | 61 64 73 20 63 6f 6d 70 |two thre|ads comp|
|000058b0| 65 74 65 20 66 6f 72 20 | 61 20 72 65 73 6f 75 72 |ete for |a resour|
|000058c0| 63 65 2e 20 54 77 6f 20 | 74 68 72 65 61 64 73 20 |ce. Two |threads |
|000058d0| 74 68 61 74 20 61 72 65 | 20 65 78 65 63 75 74 69 |that are| executi|
|000058e0| 6e 67 20 61 74 20 74 68 | 65 20 73 61 6d 65 20 74 |ng at th|e same t|
|000058f0| 69 6d 65 20 6d 61 79 20 | 65 61 63 68 20 77 61 6e |ime may |each wan|
|00005900| 74 20 65 78 63 6c 75 73 | 69 76 65 20 75 73 65 20 |t exclus|ive use |
|00005910| 6f 66 20 74 68 65 20 73 | 61 6d 65 20 64 65 76 69 |of the s|ame devi|
|00005920| 63 65 2c 20 66 69 6c 65 | 2c 20 6f 72 20 6d 65 6d |ce, file|, or mem|
|00005930| 6f 72 79 20 6c 6f 63 61 | 74 69 6f 6e 2e 0d 54 6f |ory loca|tion..To|
|00005940| 20 64 65 61 6c 20 77 69 | 74 68 20 74 68 69 73 20 | deal wi|th this |
|00005950| 73 69 74 75 61 74 69 6f | 6e 2c 20 79 6f 75 20 61 |situatio|n, you a|
|00005960| 73 73 69 67 6e 20 61 20 | 73 65 6d 61 70 68 6f 72 |ssign a |semaphor|
|00005970| 65 20 74 6f 20 63 6f 6e | 74 72 6f 6c 20 61 63 63 |e to con|trol acc|
|00005980| 65 73 73 20 74 6f 20 74 | 68 69 73 20 72 65 73 6f |ess to t|his reso|
|00005990| 75 72 63 65 2e 20 54 68 | 65 6e 2c 20 77 68 65 6e |urce. Th|en, when|
|000059a0| 20 79 6f 75 20 77 72 69 | 74 65 20 74 68 65 20 74 | you wri|te the t|
|000059b0| 68 72 65 61 64 20 74 68 | 61 74 20 75 73 65 73 20 |hread th|at uses |
|000059c0| 74 68 65 20 72 65 73 6f | 75 72 63 65 2c 20 79 6f |the reso|urce, yo|
|000059d0| 75 20 61 6c 77 61 79 73 | 20 6d 61 6b 65 20 73 75 |u always| make su|
|000059e0| 72 65 20 74 68 61 74 20 | 74 68 65 20 74 68 72 65 |re that |the thre|
|000059f0| 61 64 20 d2 67 72 61 62 | 73 d3 20 74 68 65 20 73 |ad .grab|s. the s|
|00005a00| 65 6d 61 70 68 6f 72 65 | 2e 20 41 66 74 65 72 20 |emaphore|. After |
|00005a10| 79 6f 75 d5 72 65 20 64 | 6f 6e 65 20 77 69 74 68 |you.re d|one with|
|00005a20| 20 74 68 65 20 72 65 73 | 6f 75 72 63 65 2c 20 79 | the res|ource, y|
|00005a30| 6f 75 20 d2 72 65 6c 65 | 61 73 65 d3 20 74 68 65 |ou .rele|ase. the|
|00005a40| 20 73 65 6d 61 70 68 6f | 72 65 2e 20 20 0d 57 68 | semapho|re. .Wh|
|00005a50| 61 74 20 68 61 70 70 65 | 6e 73 20 69 66 20 61 20 |at happe|ns if a |
|00005a60| 74 68 72 65 61 64 20 74 | 72 69 65 73 20 74 6f 20 |thread t|ries to |
|00005a70| 67 72 61 62 20 61 20 73 | 65 6d 61 70 68 6f 72 65 |grab a s|emaphore|
|00005a80| 20 74 68 61 74 20 68 61 | 73 20 61 6c 72 65 61 64 | that ha|s alread|
|00005a90| 79 20 62 65 65 6e 20 67 | 72 61 62 62 65 64 3f 20 |y been g|rabbed? |
|00005aa0| 54 68 65 20 74 68 72 65 | 61 64 20 67 6f 65 73 20 |The thre|ad goes |
|00005ab0| 74 6f 20 73 6c 65 65 70 | 2c 20 77 61 69 74 69 6e |to sleep|, waitin|
|00005ac0| 67 20 69 6e 20 61 20 71 | 75 65 75 65 20 61 73 73 |g in a q|ueue ass|
|00005ad0| 6f 63 69 61 74 65 64 20 | 77 69 74 68 20 74 68 65 |ociated |with the|
|00005ae0| 20 73 65 6d 61 70 68 6f | 72 65 2e 20 57 68 65 6e | semapho|re. When|
|00005af0| 20 74 68 65 20 73 65 6d | 61 70 68 6f 72 65 20 64 | the sem|aphore d|
|00005b00| 6f 65 73 20 62 65 63 6f | 6d 65 20 61 76 61 69 6c |oes beco|me avail|
|00005b10| 61 62 6c 65 2c 20 74 68 | 65 20 73 6c 65 65 70 69 |able, th|e sleepi|
|00005b20| 6e 67 20 74 68 72 65 61 | 64 20 77 61 6b 65 73 20 |ng threa|d wakes |
|00005b30| 75 70 20 77 69 74 68 20 | 63 6f 6e 74 72 6f 6c 20 |up with |control |
|00005b40| 6f 66 20 74 68 65 20 73 | 65 6d 61 70 68 6f 72 65 |of the s|emaphore|
|00005b50| 2c 20 63 6f 6d 70 6c 65 | 74 65 6c 79 20 75 6e 61 |, comple|tely una|
|00005b60| 77 61 72 65 20 74 68 61 | 74 20 69 74 20 68 61 64 |ware tha|t it had|
|00005b70| 20 74 6f 20 77 61 69 74 | 20 69 6e 20 74 68 65 20 | to wait| in the |
|00005b80| 71 75 65 75 65 2e 20 49 | 74 20 63 6f 6e 74 69 6e |queue. I|t contin|
|00005b90| 75 65 73 20 65 78 65 63 | 75 74 69 6e 67 20 63 6f |ues exec|uting co|
|00005ba0| 64 65 20 61 73 20 75 73 | 75 61 6c 2c 20 61 6e 64 |de as us|ual, and|
|00005bb0| 20 72 65 6c 65 61 73 65 | 73 20 74 68 65 20 73 65 | release|s the se|
|00005bc0| 6d 61 70 68 6f 72 65 20 | 77 68 65 6e 20 69 74 d5 |maphore |when it.|
|00005bd0| 73 20 64 6f 6e 65 2c 20 | 74 68 75 73 20 67 69 76 |s done, |thus giv|
|00005be0| 69 6e 67 20 6f 74 68 65 | 72 20 74 68 72 65 61 64 |ing othe|r thread|
|00005bf0| 73 20 61 6e 20 6f 70 70 | 6f 72 74 75 6e 69 74 79 |s an opp|ortunity|
|00005c00| 20 74 6f 20 75 73 65 20 | 74 68 65 20 72 65 73 6f | to use |the reso|
|00005c10| 75 72 63 65 2e 0d 42 65 | 6c 6f 77 20 69 73 20 61 |urce..Be|low is a|
|00005c20| 20 73 6d 61 6c 6c 20 65 | 78 61 6d 70 6c 65 20 70 | small e|xample p|
|00005c30| 72 6f 67 72 61 6d 20 74 | 68 61 74 20 64 65 6d 6f |rogram t|hat demo|
|00005c40| 6e 73 74 72 61 74 65 73 | 20 74 68 65 20 62 65 68 |nstrates| the beh|
|00005c50| 61 76 69 6f 72 20 6f 66 | 20 73 65 6d 61 70 68 6f |avior of| semapho|
|00005c60| 72 65 73 2e 20 49 74 d5 | 73 20 76 65 72 79 20 73 |res. It.|s very s|
|00005c70| 69 6d 69 6c 61 72 20 74 | 6f 20 74 68 65 20 66 69 |imilar t|o the fi|
|00005c80| 72 73 74 20 65 78 61 6d | 70 6c 65 2c 20 65 78 63 |rst exam|ple, exc|
|00005c90| 65 70 74 20 74 68 61 74 | 20 74 68 65 20 62 65 65 |ept that| the bee|
|00005ca0| 70 69 6e 67 20 74 68 72 | 65 61 64 20 67 72 61 62 |ping thr|ead grab|
|00005cb0| 73 20 61 20 73 65 6d 61 | 70 68 6f 72 65 20 62 65 |s a sema|phore be|
|00005cc0| 66 6f 72 65 20 62 65 65 | 70 69 6e 67 20 34 20 74 |fore bee|ping 4 t|
|00005cd0| 69 6d 65 73 20 61 6e 64 | 20 74 68 65 6e 20 72 65 |imes and| then re|
|00005ce0| 6c 65 61 73 65 73 20 69 | 74 2e 20 41 20 63 61 6c |leases i|t. A cal|
|00005cf0| 6c 20 74 6f 20 59 69 65 | 6c 64 20 77 61 73 20 69 |l to Yie|ld was i|
|00005d00| 6e 73 65 72 74 65 64 20 | 77 69 74 68 69 6e 20 74 |nserted |within t|
|00005d10| 68 69 73 20 69 6e 6e 65 | 72 20 6c 6f 6f 70 20 6a |his inne|r loop j|
|00005d20| 75 73 74 20 74 6f 20 64 | 65 6d 6f 6e 73 74 72 61 |ust to d|emonstra|
|00005d30| 74 65 20 74 68 61 74 20 | 65 76 65 6e 20 74 68 6f |te that |even tho|
|00005d40| 75 67 68 20 74 68 65 72 | 65 20 69 73 20 61 20 63 |ugh ther|e is a c|
|00005d50| 61 6c 6c 20 74 6f 20 59 | 69 65 6c 64 20 69 6e 20 |all to Y|ield in |
|00005d60| 74 68 65 20 6c 6f 6f 70 | 2c 20 6e 6f 20 62 61 6c |the loop|, no bal|
|00005d70| 6c 73 20 61 72 65 20 64 | 72 61 77 6e 20 64 75 72 |ls are d|rawn dur|
|00005d80| 69 6e 67 20 74 68 69 73 | 20 74 69 6d 65 2e 20 54 |ing this| time. T|
|00005d90| 68 69 73 20 69 73 20 62 | 65 63 61 75 73 65 20 74 |his is b|ecause t|
|00005da0| 68 65 20 63 6f 64 65 20 | 74 68 61 74 20 64 72 61 |he code |that dra|
|00005db0| 77 73 20 74 68 65 20 62 | 61 6c 6c 73 20 67 72 61 |ws the b|alls gra|
|00005dc0| 62 73 20 74 68 65 20 73 | 65 6d 61 70 68 6f 72 65 |bs the s|emaphore|
|00005dd0| 20 74 6f 6f 2e 20 57 68 | 65 6e 20 69 74 20 67 65 | too. Wh|en it ge|
|00005de0| 74 73 20 63 6f 6e 74 72 | 6f 6c 20 6f 66 20 74 68 |ts contr|ol of th|
|00005df0| 65 20 73 65 6d 61 70 68 | 6f 72 65 2c 20 69 74 20 |e semaph|ore, it |
|00005e00| 64 72 61 77 73 20 32 30 | 20 62 61 6c 6c 73 20 62 |draws 20| balls b|
|00005e10| 65 66 6f 72 65 20 6c 65 | 74 74 69 6e 67 20 67 6f |efore le|tting go|
|00005e20| 2e 20 41 66 74 65 72 20 | 79 6f 75 20 72 65 6c 65 |. After |you rele|
|00005e30| 61 73 65 20 61 20 73 65 | 6d 61 70 68 6f 72 65 2c |ase a se|maphore,|
|00005e40| 20 79 6f 75 20 73 74 69 | 6c 6c 20 68 61 76 65 20 | you sti|ll have |
|00005e50| 74 6f 20 63 61 6c 6c 20 | 59 69 65 6c 64 20 62 65 |to call |Yield be|
|00005e60| 66 6f 72 65 20 6f 74 68 | 65 72 20 74 68 72 65 61 |fore oth|er threa|
|00005e70| 64 73 20 77 69 6c 6c 20 | 67 65 74 20 63 6f 6e 74 |ds will |get cont|
|00005e80| 72 6f 6c 2e 0d 6d 61 69 | 6e 28 29 0d 7b 0d 09 54 |rol..mai|n().{..T|
|00005e90| 68 72 65 61 64 48 61 6e | 64 6c 65 20 09 09 62 65 |hreadHan|dle ..be|
|00005ea0| 65 70 54 68 72 65 61 64 | 3b 0d 09 53 65 6d 61 70 |epThread|;..Semap|
|00005eb0| 68 6f 72 65 48 61 6e 64 | 6c 65 09 61 53 65 6d 61 |horeHand|le.aSema|
|00005ec0| 70 68 6f 72 65 3b 0d 09 | 49 6e 69 74 69 61 6c 69 |phore;..|Initiali|
|00005ed0| 7a 65 28 29 3b 0d 2f 2a | 20 54 68 65 20 49 6e 69 |ze();./*| The Ini|
|00005ee0| 74 54 68 72 65 61 64 73 | 20 63 61 6c 6c 20 69 6e |tThreads| call in|
|00005ef0| 69 74 69 61 6c 69 7a 65 | 73 20 74 68 65 20 54 68 |itialize|s the Th|
|00005f00| 72 65 61 64 73 20 50 61 | 63 6b 61 67 65 2c 20 63 |reads Pa|ckage, c|
|00005f10| 6f 6e 76 65 72 74 69 6e | 67 20 74 68 65 20 6f 72 |onvertin|g the or|
|00005f20| 69 67 69 6e 61 6c 20 74 | 68 72 65 61 64 20 6f 66 |iginal t|hread of|
|00005f30| 20 65 78 65 63 75 74 69 | 6f 6e 20 69 6e 74 6f 20 | executi|on into |
|00005f40| 61 20 73 77 61 70 70 61 | 62 6c 65 20 74 68 72 65 |a swappa|ble thre|
|00005f50| 61 64 2e 20 2a 2f 0d 09 | 49 6e 69 74 54 68 72 65 |ad. */..|InitThre|
|00005f60| 61 64 73 28 6e 69 6c 2c | 20 66 61 6c 73 65 29 3b |ads(nil,| false);|
|00005f70| 0d 09 61 53 65 6d 61 70 | 68 6f 72 65 20 3d 20 4e |..aSemap|hore = N|
|00005f80| 65 77 53 65 6d 61 70 68 | 6f 72 65 28 29 3b 0d 2f |ewSemaph|ore();./|
|00005f90| 2a 20 46 6f 72 6b 20 74 | 68 65 20 62 65 65 70 69 |* Fork t|he beepi|
|00005fa0| 6e 67 20 74 68 72 65 61 | 64 2e 20 2a 2f 0d 09 69 |ng threa|d. */..i|
|00005fb0| 66 20 28 49 6e 4e 65 77 | 54 68 72 65 61 64 28 26 |f (InNew|Thread(&|
|00005fc0| 62 65 65 70 54 68 72 65 | 61 64 2c 20 6b 44 65 66 |beepThre|ad, kDef|
|00005fd0| 61 75 6c 74 53 74 61 63 | 6b 53 69 7a 65 29 29 0d |aultStac|kSize)).|
|00005fe0| 09 09 20 7b 0d 09 09 20 | 6c 6f 6e 67 20 69 2c 6a |.. {... |long i,j|
|00005ff0| 3b 0d 09 09 20 59 69 65 | 6c 64 28 29 3b 0d 09 09 |;... Yie|ld();...|
|00006000| 20 66 6f 72 20 28 69 3d | 30 3b 20 69 3c 31 30 3b | for (i=|0; i<10;|
|00006010| 20 69 2b 2b 29 0d 09 09 | 09 20 20 7b 0d 2f 2a 20 | i++)...|. {./* |
|00006020| 47 72 61 62 20 74 68 65 | 20 73 65 6d 61 70 68 6f |Grab the| semapho|
|00006030| 72 65 2c 20 62 65 65 70 | 20 34 20 74 69 6d 65 73 |re, beep| 4 times|
|00006040| 2c 20 61 6e 64 20 72 65 | 6c 65 61 73 65 20 74 68 |, and re|lease th|
|00006050| 65 20 73 65 6d 61 70 68 | 6f 72 65 2e 20 2a 2f 0d |e semaph|ore. */.|
|00006060| 09 09 09 20 20 47 72 61 | 62 53 65 6d 61 70 68 6f |... Gra|bSemapho|
|00006070| 72 65 28 61 53 65 6d 61 | 70 68 6f 72 65 29 3b 0d |re(aSema|phore);.|
|00006080| 09 09 09 20 20 66 6f 72 | 20 28 6a 3d 30 3b 20 6a |... for| (j=0; j|
|00006090| 3c 34 3b 20 6a 2b 2b 29 | 0d 09 09 09 09 20 20 7b |<4; j++)|..... {|
|000060a0| 0d 09 09 09 09 20 20 53 | 79 73 42 65 65 70 28 31 |..... S|ysBeep(1|
|000060b0| 32 30 29 3b 0d 09 09 09 | 09 20 20 59 69 65 6c 64 |20);....|. Yield|
|000060c0| 28 29 3b 0d 09 09 09 09 | 20 20 7d 0d 09 09 09 20 |();.....| }.... |
|000060d0| 20 52 65 6c 65 61 73 65 | 53 65 6d 61 70 68 6f 72 | Release|Semaphor|
|000060e0| 65 28 61 53 65 6d 61 70 | 68 6f 72 65 29 3b 0d 09 |e(aSemap|hore);..|
|000060f0| 09 09 20 20 7d 0d 09 09 | 20 20 45 6e 64 54 68 72 |.. }...| EndThr|
|00006100| 65 61 64 28 62 65 65 70 | 54 68 72 65 61 64 29 3b |ead(beep|Thread);|
|00006110| 0d 09 09 20 20 7d 0d 0d | 2f 2a 20 48 65 72 65 27 |... }..|/* Here'|
|00006120| 73 20 74 68 65 20 6d 61 | 69 6e 20 65 76 65 6e 74 |s the ma|in event|
|00006130| 20 6c 6f 6f 70 2e 20 2a | 2f 0d 09 20 64 6f 0d 09 | loop. *|/.. do..|
|00006140| 09 20 7b 0d 09 09 20 6c | 6f 6e 67 20 6a 3b 0d 09 |. {... l|ong j;..|
|00006150| 09 20 59 69 65 6c 64 28 | 29 3b 0d 2f 2a 20 47 72 |. Yield(|);./* Gr|
|00006160| 61 62 20 74 68 65 20 73 | 65 6d 61 70 68 6f 72 65 |ab the s|emaphore|
|00006170| 2c 20 64 72 61 77 20 32 | 30 20 62 61 6c 6c 73 2c |, draw 2|0 balls,|
|00006180| 20 61 6e 64 20 72 65 6c | 65 61 73 65 20 74 68 65 | and rel|ease the|
|00006190| 20 73 65 6d 61 70 68 6f | 72 65 2e 20 2a 2f 0d 09 | semapho|re. */..|
|000061a0| 09 20 47 72 61 62 53 65 | 6d 61 70 68 6f 72 65 28 |. GrabSe|maphore(|
|000061b0| 61 53 65 6d 61 70 68 6f | 72 65 29 3b 0d 09 09 20 |aSemapho|re);... |
|000061c0| 66 6f 72 20 28 6a 3d 30 | 3b 20 6a 3c 32 30 3b 20 |for (j=0|; j<20; |
|000061d0| 6a 2b 2b 29 0d 09 09 09 | 20 20 7b 0d 09 09 09 20 |j++)....| {.... |
|000061e0| 20 4e 65 77 42 61 6c 6c | 28 29 3b 0d 09 09 09 20 | NewBall|();.... |
|000061f0| 20 59 69 65 6c 64 28 29 | 3b 0d 09 09 09 20 20 7d | Yield()|;.... }|
|00006200| 0d 09 09 20 52 65 6c 65 | 61 73 65 53 65 6d 61 70 |... Rele|aseSemap|
|00006210| 68 6f 72 65 28 61 53 65 | 6d 61 70 68 6f 72 65 29 |hore(aSe|maphore)|
|00006220| 3b 0d 09 09 0d 09 09 20 | 7d 20 77 68 69 6c 65 20 |;...... |} while |
|00006230| 28 21 42 75 74 74 6f 6e | 28 29 29 3b 0d 2f 2a 20 |(!Button|());./* |
|00006240| 54 68 69 73 20 63 61 6c | 6c 20 74 6f 20 45 78 69 |This cal|l to Exi|
|00006250| 74 54 68 72 65 61 64 73 | 20 77 61 69 74 73 20 66 |tThreads| waits f|
|00006260| 6f 72 20 61 6c 6c 20 74 | 68 72 65 61 64 73 20 74 |or all t|hreads t|
|00006270| 6f 20 64 69 65 20 62 65 | 66 6f 72 65 20 61 6c 6c |o die be|fore all|
|00006280| 6f 77 69 6e 67 20 74 68 | 65 20 70 72 6f 67 72 61 |owing th|e progra|
|00006290| 6d 20 74 6f 20 74 65 72 | 6d 69 6e 61 74 65 2e 20 |m to ter|minate. |
|000062a0| 2a 2f 0d 09 20 45 78 69 | 74 54 68 72 65 61 64 73 |*/.. Exi|tThreads|
|000062b0| 28 29 3b 0d 7d 0d 49 4d | 50 4c 45 4d 45 4e 54 49 |();.}.IM|PLEMENTI|
|000062c0| 4e 47 20 54 48 52 45 41 | 44 53 20 4f 4e 20 54 48 |NG THREA|DS ON TH|
|000062d0| 45 20 4d 41 43 49 4e 54 | 4f 53 48 0d 41 66 74 65 |E MACINT|OSH.Afte|
|000062e0| 72 20 65 78 61 6d 69 6e | 69 6e 67 20 74 68 65 20 |r examin|ing the |
|000062f0| 72 61 6d 69 66 69 63 61 | 74 69 6f 6e 73 20 6f 66 |ramifica|tions of|
|00006300| 20 69 6d 70 6c 65 6d 65 | 6e 74 69 6e 67 20 74 68 | impleme|nting th|
|00006310| 72 65 61 64 73 20 69 6e | 20 74 68 65 20 4d 61 63 |reads in| the Mac|
|00006320| 69 6e 74 6f 73 68 20 72 | 75 6e 2d 74 69 6d 65 20 |intosh r|un-time |
|00006330| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 2c 20 77 65 20 |environm|ent, we |
|00006340| 69 64 65 6e 74 69 66 69 | 65 64 20 74 68 72 65 65 |identifi|ed three|
|00006350| 20 73 65 72 69 6f 75 73 | 20 70 72 6f 62 6c 65 6d | serious| problem|
|00006360| 73 3a 0d 09 a5 20 6e 6f | 6e 2d 72 65 65 6e 74 72 |s:... no|n-reentr|
|00006370| 61 6e 74 20 54 6f 6f 6c | 62 6f 78 20 61 6e 64 20 |ant Tool|box and |
|00006380| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 63 6f 64 65 |applicat|ion code|
|00006390| 0d 09 a5 20 54 6f 6f 6c | 62 6f 78 20 75 73 65 20 |... Tool|box use |
|000063a0| 6f 66 20 6d 65 6d 6f 72 | 79 20 62 65 74 77 65 65 |of memor|y betwee|
|000063b0| 6e 20 74 68 65 20 73 74 | 61 63 6b 20 61 6e 64 20 |n the st|ack and |
|000063c0| 74 68 65 20 68 65 61 70 | 0d 09 a5 20 73 65 67 6d |the heap|... segm|
|000063d0| 65 6e 74 20 75 6e 6c 6f | 61 64 69 6e 67 0d 41 6c |ent unlo|ading.Al|
|000063e0| 74 68 6f 75 67 68 20 74 | 68 65 20 54 68 72 65 61 |though t|he Threa|
|000063f0| 64 73 20 50 61 63 6b 61 | 67 65 20 6d 69 6e 69 6d |ds Packa|ge minim|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.